|
<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
|
|
|
|
|
There's tons of sample code, and a mailing list/forum, on the gmaps site.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
I have developed the website which connects sql server using windows authentication. It works fine in local. but when i deploy it in online it shows error while connecting with the sql. The error is "Login failed for user 'C60536-52290\IUSR_ADSTESTSERVER'".
When i search in google i found to change in IIS as "Disable anonymous access" . I have changed and gave apply it opens a windows as "Inheritance Overrides" The following child nodes also defines the values of the UNCPassword property whcih overrides the value you have just set.Please select from the list below those nodes which should use the new value. The list are sitemap.xml,ror.xml,generator/data.
Can any one help me to solve this problem
Thanks
|
|
|
|
|
Hi,
I have a webapplication(Ajax Enabled asp.net web application) in which i have only a plane Default.aspx file along with web.config.....and using setup and Deployment i have created an msi.. and i deployed it on the other system....and im able get the below error..
Exception Details: System.Security.SecurityException: Requested registry access is not allowed.
By the way i have not written any code in the cs file....Please help me out...
While deploying(ie while creating msi) i kept my dll"s in bin folder and set the Execute permissions property of bin folder to vsdepScriptsAndExecutables...and added the project output(primary out put and content files)to the setup project..and after building the setup project i took the msi file and installed in other system and im able to get the above error...
|
|
|
|
|
do you install as admin ?
Why do you need an msi to install a web app ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Yes im installing as admin...
im creating as msi bcos it is going to use by the service person who is not aware of creating virtual directory stuff...please let is it not a better practice to create an msi for a web application...i guess but im not sure that i need to set something for my webapplication properties when it is dumped in inetmgr..ie under Default websites...
|
|
|
|
|
project output/primary in bin folder is not enough. Add the ajax files and it will work. That is what I am doing. Hope this helps.
|
|
|
|
|
ya i have added system.web.extensions and System.web.Extensions.Design and Ajaxcontroltoolkit.dll.....still it"s giving the same error...
|
|
|
|
|
Hi
I am developing a web application in ASP.Net 2.0
I have a web page for project registration in which I can add project details like Project code, name description,start date, end date etc. I want to include in this page the project members and roles.
I have added a table with 2 columns which contains combo boxes bounded to Project member table and roles table. Also a button to add new member. On click of the add button i create new row to the table with combo box controls bounded to project members and roles. But I cannot retrieve the selected values of the dynamically added controls.
Can any one please help me to solve this.
With kind regards,
Jimi
|
|
|
|
|
Dynamically created controls need to be created before page load in order for viewstate to populate. OR you need to use hidden controls to store the values you want.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|