cannot get value from datagrid

T

Tom

i have the following code:

private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs
e)

{

TextBox b;

b = DataGrid1.Items[DataGrid1.SelectedIndex].FindControl("tbcustomer") as
TextBox;


if(b != null)

{

Response.Write(b.Text);

}

}

i can find the control in b but the b.Text is empty while i put a value in
my datagrid?



ch Tom
 
R

R. Thomas, aka Xtreme.Net

First of all Tom, did u change the id of the control anywhere?
Second, the b that you are getting is it the correct b that you are looking
for?
Third, try CType it to a textbox.
Try to pin point where the problem lies..
Hth...
R. Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top