|
-
February 11th, 2003, 10:57 AM
#1
How can I get Value from selected row in datagrid
Hello Everyone
I have been trying to get the value from selected row in Datagrid for ASP.NET, I have been looking everywhere for some code but without result, how can I do this
Thanks in Advance
Jon Sveinsson
-
February 13th, 2003, 05:45 PM
#2
I haven't used the datagrid in this way yet but this will probably work:
TextBox txt = (TextBox)dg.Items[dg.SelectedIndex].Controls[myTextID];
string val = txt.Text;
(where dg is a reference to your datagrid)
-
February 24th, 2003, 03:13 AM
#3
if you're working with VB this should work
Dim GridValue as string = CType(e.Item.Cells(0).Controls(0), TextBox).Text
GridValue being the variable for the new value you're trying to get. e.Item.Cells(0) the number within those paranthesis corresponds to column you're trying to get to.
hope this helps
guyute
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|