Editing a hyperlinkcontrl in a gridview

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2007
Posts: 12
Reputation: aerian is an unknown quantity at this point 
Solved Threads: 0
aerian aerian is offline Offline
Newbie Poster

Editing a hyperlinkcontrl in a gridview

 
0
  #1
May 2nd, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1040 | Replies: 0
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC