Datagrid Question

G

Guest

Hi Guys,

I am programming in VB .net. I have a datagrid with template column. Each
row as Checkbox and a Linkbutton in it. I have defined onCommand for
Linkbutton. I am having trouble figuring out how to find if the checkbox is
selected or not and retrieve value set for check box.

Please assist me on this.

Thanks

Manny
 
E

Elton Wang

Hi Manny,

You can use linkButton object's NamingContainer property
to find out clicked DataGridItem. Then use the
DataGridItem's FindControl method to get CheckBox object.


HTH

Elton Wang
(e-mail address removed)
 
B

Brock Allen

In the Grid's ItemCommand event find the Checkbox via the ItemCommandEventArgs.Item.FindControl()
method.

CheckBox cb = e.Item.FindControl("CheckBoxID") as CheckBox;
// now get cb.Checked
 

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,813
Messages
2,569,699
Members
45,489
Latest member
SwethaJ

Latest Threads

Top