How to get the value of the textbox created using itemtemplate in grid view

Hi friends,

I have a gridview where i created a textbox using itemtemplate. So then when i click the update (autoeditbutton) i can't get the value of that textbox. which i need to update to my database.

 Note: I have used Findcontrol, directcast etc in rowupdating even though i cant data in that textbox.

Pls help me.

Thanks,

venkat.. 

 

 

 

0
venkatramcse
12/3/2008 8:02:41 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

3 Replies
514 Views

Similar Articles

[PageSpeed] 14

Private Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating 

Dim mytxtbox As TextBox = CType(GridView1.Rows(e.RowIndex).Cells(5).FindControl("MyTextBoxName"), TextBox)
'mytxtbox.text is what you will use!

End Sub

0
jgangwisch
12/3/2008 9:02:16 PM

if (e.CommandName == "Select")
 String textbox;
        {
            int index = Convert.ToInt32(e.CommandArgument);
            GridViewRow selectedRow = GridView1.Rows[index];
            TableCell name = selectedRow.Cells[1];
            textbox = name.Text;        
        }


~~ Believe in Science, not religion. Science will always progress, religions will always collapse. ~~
0
TheDirtyBird
12/3/2008 9:17:06 PM

Thanks dude,

I got it...

0
venkatramcse
12/3/2008 10:10:37 PM
Reply: