|
hi all
i have created a datatable with some columns.
then i added a report file and set the fields using datatable.
then i have taken a reportviewcontrol in my .aspx page
now i bind my report in runtime
everything is going fine but when the report is generated the value data drop field of report is one (but i datatable the value is more than one).
for coding please check the article :
http://www.aspfree.com/c/a/ASP.NET/Binding-Data-to-the-ReportViewer-Control-Dynamically-in-ASPNET-20
Er. Jagwinder Singh
|
|
|
|
|
Try this video about ReportViewer
http://download.microsoft.com/download/4/1/9/4191d186-e2a1-4b45-b4dd-b6364a4d5ced/14ReportViewer.zip
|
|
|
|
|
is it possible to display the checkboxes on the right side of a gridview when we use template field..
scarface
|
|
|
|
|
Yes, you can just go in gridview property and change order of columns.
|
|
|
|
|
i did check the properties of gridview but where is the ordering of the columns..
scarface
|
|
|
|
|
Go to .aspx page.In the gridview inside columns the column names alongwith it's properties are there.You just move that checkbox row to the last order.
|
|
|
|
|
well i did try dragging the checkbox column but thats not working..and i checked in the properties but there is no option for that..
scarface
|
|
|
|
|
what man u have to just move the checkbox column to the last order in aspx code.
say:<column 1:asd="" xmlns:1="#unknown"><column 2:sd="" xmlns:2="#unknown"><column 3:checkbox="" xmlns:3="#unknown">Like that order only u have to keep.
|
|
|
|
|
hey that message wasnt getting displayed..i tried in code..but there is no property as ordering of columns..am not getting as to where are you referring to change..
hey thanks for your help..
scarface
|
|
|
|
|
<Columns>
<asp:BoundField DataField="Country_ID" HeaderText="Country_ID" InsertVisible="False"
ReadOnly="True" SortExpression="Country_ID" />
<asp:BoundField DataField="Country_Name" HeaderText="Country_Name" SortExpression="Country_Name" />
<asp:BoundField DataField="Continent_ID" HeaderText="Continent_ID" SortExpression="Continent_ID" />
<asp:BoundField DataField="Continent_Name" HeaderText="Continent_Name" SortExpression="Continent_Name" />
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID ="df" runat ="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
just replace < and > with< and > resp and try.
|
|
|
|
|
i dint get this line < and > with < and > resp and try...
and am not using bound field..am having a gridview in which am using template field which has checkbox and am filling the data inside it with a datatable which is binded with the gridview..
scarface
|
|
|
|
|
|
here's my code..
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField headertext="select">
<ItemTemplate>
<asp:CheckBox ID="chkbx" runat="server" /></ItemTemplate></asp:TemplateField></Columns>
</asp:GridView>
scarface
|
|
|
|
|
make the autogeneratecolumns="false" and add whatever columns u need in the columns section as boundfield or temp field watever u like.
|
|
|
|
|
this is my code:
protected void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
this.TextBox1.Text = System.DateTime.Now.ToShortDateString();
this.pnlCalendar.Attributes.Add("style", "DISPLAY: none; POSITION: absolute");
}
else
{
string id = Page.Request.Form["__EVENTTARGET"].Substring(0,Page.Request.Form["__EVENTTARGET"].IndexOf(":"));
if (id != this.ID)
{
this.pnlCalendar.Attributes.Add("style","DISPLAY: none; POSITION: absolute");
}
else
{
this.pnlCalendar.Attributes.Add("style","POSITION: absolute");
}
}
Page.RegisterClientScriptBlock("Script_Panel" + this.ID, " function On"+this.ID+"Click() { if("+this.ID+"_pnlCalendar.style.display == \"none\") "+this.ID+"_pnlCalendar.style.display = \"\"; else "+this.ID+"_pnlCalendar.style.display = \"none\"; } ");
this.Button1.Attributes.Add("OnClick","On"+this.ID+"Click()");
}
and for changing the date:
protected void Calendar1_SelectionChanged(object sender, System.EventArgs e)
{
this.TextBox1.Text = Calendar1.SelectedDate.ToShortDateString();
this.pnlCalendar.Attributes.Add("style", "DISPLAY: none; POSITION: absolute");
}
now iam getting the error as below :please can any one help me to run properly my code:
Length cannot be less than zero.
Parameter name: length
error is generated at this lines:
Source Error:
Line 23: else
Line 24: {
Line 25: string id = Page.Request.Form["__EVENTTARGET"].Substring(0,Page.Request.Form["__EVENTTARGET"].IndexOf(":"));
Line 26: if (id != this.ID)
Line 27: {
|
|
|
|
|
Well, it means what it says. The index of the : is -1. there's no colon in the string. This is bad code, never ask for something without first making sure it's there.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Experts,
I placed a marker in the google map,in the marker i have a tab which includes image and name.so,when i click the image or name it should redirect to a page.
Note : I have placed the google map in the iframe.
Thanks in advance.
|
|
|
|
|
after selecting the rows through checkbox in first gridview and transfering them to second gridview i want the selected rows to get deleted from the first gridview..i want to delete the rows only in the front end and not from database since i have used sql data source to fill the first gridview..is this possible..below is the code which i have used..
foreach (GridViewRow row in GridView1.Rows)
{
string upstr = "UPDATE emp SET flag = '1' WHERE empId = ";
CheckBox ch = (CheckBox)(row.FindControl("chkbx1"));
if (ch.Checked == true)
{
int Id = Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Value);
idArr.Add(Id);
upstr += "'" + Id + "'";
conn = new SqlConnection(constr);
conn.Open();
SqlCommand comm = new SqlCommand(upstr, conn);
comm.ExecuteNonQuery();
conn.Close();
GridView1.DeleteRow(Id);
ch.Checked = false;
}
}
when i am compiling this am getting ""Deleting is not supported by data source 'empReq' unless DeleteCommand is specified."
scarface
|
|
|
|
|
Have you written the deletecommand in the property like deletecommand="delete from table where rowid=2 ";
|
|
|
|
|
but i want the rows to be deleted only from front end and not from database..is it possible..
scarface
|
|
|
|
|
Then i think put the data in an xml format or any dataset.whichever rows you select for delete, delete them from the dataset.Then bind it to Grid.
|
|
|
|
|
can you just show some sample code for this..
scarface
|
|
|
|
|
<asp:gridview id="GridView1" runat="server" onsorting="GridView1_Sorting" xmlns:asp="#unknown">
<columns> <asp:templatefield>
<itemtemplate>
<asp:checkbox id="CheckBox1" runat="server" autopostback="true" oncheckedchanged="CheckBox1_CheckedChanged">
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
CheckBox chk = (CheckBox)sender;
GridViewRow myrow = (GridViewRow)chk.NamingContainer;
myrow.Visible = false;
}
god is great
|
|
|
|
|
Hello Friends,
I'm creating a shared assembly. I've created an library file and also created an unique strong name but now not getting Assemblyinfo.cs for adding the assemblykey file. So please let me know how can i get it.....
|
|
|
|
|
Hi Experts,
I am using Gmap Control for selecting a place by user..I am placing marker on click event.
But the problem comes,when user clicks second time the second marker is creating.. I want to remove marker and i want to place newmarker..
how can i do that..
Thanks
|
|
|
|