|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Datagrid QuestionHi 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 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----- template column. Each >Hi Guys, > >I am programming in VB .net. I have a datagrid with >row as Checkbox and a Linkbutton in it. I have defined if the checkbox is onCommand for >Linkbutton. I am having trouble figuring out how to find Show quoteHide quote >selected or not and retrieve value set for check box. > >Please assist me on this. > >Thanks > >Manny >. > 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 >
Other interesting topics
Session("passed") = Session("passed") + 1 error
cheap and reliable ASP.Net web hoster Dynamic CheckBoxList??? FormsAuthentication.SignOut() not working when manually creating a ticket? Server.GetLastError Hide / Show Details Sending emails Q: select value in dropdown list DataReader... and ... Q: sum grid column |
|||||||||||||||||||||||