Home All Groups Group Topic Archive Search About
Author
14 Apr 2005 9:14 PM
Manny Chohan
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

Author
15 Apr 2005 1:26 AM
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
elton_w***@hotmail.com


>-----Original Message-----
>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
Show quoteHide quote
>selected or not and retrieve value set for check box.
>
>Please assist me on this.
>
>Thanks
>
>Manny
>.
>
Are all your drivers up to date? click for free checkup

Author
15 Apr 2005 3:26 PM
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

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> 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
>

Bookmark and Share