| | |
Editing a hyperlinkcontrl in a gridview
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2007
Posts: 12
Reputation:
Solved Threads: 0
hye!
i m editing a grid view row which contains 2 columns.
lineid,filereference .
lineid is read only but fileref is a template field i take it as hyperlink ,and hyperlink is editable.
i m taking command fields of edit,update,cancel.
but when i run ma program it is giving an error
error: unable to cast system.ui.web literalscontrol to System.UI.WEbcontrols and index out of range i m giving the correct index but i dont know why it is goiving this error
n this error generates where i m writing
textbox refno=(TexBox) dgcontainer.Rows[e.RowIndex].Cells[4].Controls[0]);
the code for the updating event is as below:
[
protected void dgcontainer_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
TextBox refno = (TextBox)(dgcontainer.Rows[e.RowIndex].Cells[4].Controls[0]);
container.refnumber = refno.Text;
container.lineid=int.Parse(dgcontainer.Rows[e.RowIndex].Cells[0].Text);
container.updatecontainer();
this.Dispose();
dgcontainer.EditIndex=-1;
getdata();
}
]
plz help me to sort out this prob.
i m editing a grid view row which contains 2 columns.
lineid,filereference .
lineid is read only but fileref is a template field i take it as hyperlink ,and hyperlink is editable.
i m taking command fields of edit,update,cancel.
but when i run ma program it is giving an error
error: unable to cast system.ui.web literalscontrol to System.UI.WEbcontrols and index out of range i m giving the correct index but i dont know why it is goiving this error
n this error generates where i m writing
textbox refno=(TexBox) dgcontainer.Rows[e.RowIndex].Cells[4].Controls[0]);
the code for the updating event is as below:
[
protected void dgcontainer_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
TextBox refno = (TextBox)(dgcontainer.Rows[e.RowIndex].Cells[4].Controls[0]);
container.refnumber = refno.Text;
container.lineid=int.Parse(dgcontainer.Rows[e.RowIndex].Cells[0].Text);
container.updatecontainer();
this.Dispose();
dgcontainer.EditIndex=-1;
getdata();
}
]
plz help me to sort out this prob.
![]() |
Similar Threads
- Editing windows registry (VB.NET)
- MultiLine TextBoxes in GridView edit mode (ASP.NET)
- C# .NET Gridview (C#)
- GridView hiding cells dynamically (ASP.NET)
- Lost All My Hard Drive Space editing wav files (Windows NT / 2000 / XP)
- ISO Photo Editing Software (Graphics and Multimedia)
- Searching for software with scanning, text/graphic editing, etc. functions (*nix Software)
- Computer for video editing... (Troubleshooting Dead Machines)
Other Threads in the ASP.NET Forum
- Previous Thread: need help here
- Next Thread: any body there to help me
Views: 1040 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 ajax alltypeofvideos anathor appliances application asp asp.net bc30451 beginner box browser button c# cac checkbox commonfunctions complex connection dataaccesslayer database datagridview datagridviewcheckbox datalist development dgv dialog dropdownlist dynamically edit editing expose feedback fileuploader fill flash form formatdecimal formview google gridview gudi iis image javascript list listbox login microsoft migration mouse mssql news numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows save schoolproject search security select session sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 suse textbox theft tracking treeview unauthorized validatedate validation vb.net video videos vista visualstudio web webapplications webprogramming webservice xsl youareanotmemberofthedebuggerusers





