DataGrid

R

Rodrigo Ferreira

Hello,

In my project i have a datagrid with 3 columns:

ID C1 C2
1 Image true
2 Sound true

In C2 i have a CheckBox.

What i want is: when i change de checkbox state, run the CheckedChanged
event. Inside this i have a sql comand.

For run this commannd i need to know what's the value of column ID in that
especif row! And i don't know how to do that!

Greetings,

Rodrigo Ferreira
 
G

Guest

hi,
IN order to get the value of a field based on the row you just select, you
need to handle the datagrid_ItemDatabound event

Then to acces the value of a particaular field use following code :

Id = DataBinder.Eval(e.Item.DataItem, "ID"))

regards
serge
 

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
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top