finding the control types inside a datagrid

G

Guest

Hi,

I have a datagrid which contains some bound columns, some template
columns. The template columns contain text box in one column, Hyperlink
column in other column, dropdownlist in another column etc. Now I would like
to read the values in each of these columns. Inorder to read those I am doing

string text1 = CType(datagrid1.Items(0).cells(0).controls(0), TextBox).Text
string text2 = CType(datagrid1.Items(0).cells(1).controls(0), LinkButton).Text

In the above example I am hardcoding the control types like TextBox,
LinkButton etc. Instead of doing that I would like to get the type of control
first and then get the text from that control. I am not knowing how to get
the Control Type. If I do
datagrid1.Items(0).cells(0).controls(0).GetType.ToString() it is giving
TableCell for all the controls. Please let me know.

Thanks,
Sridhar.
 

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

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top