I cannot get the value of my checkbox .. because it located on the footnote of a datagrid.. could any body please help me how to get it? .. I already tried below code .. but I still cannot get the value: Dim mControl as Control mControl=gridTest.findcontrol("chkFootNote")
the result is mControl is nothing If (Not mControl Is Nothing) then ...... it have to be here!!!.... else ' it goes here ...... ;>( endif Regards Lucrecia
I place the checkbox on the footnote of my datagrid by using template and drag the checkbox to the footnote template.. do you have any solution according to my case? .. thanks Lucrecia
I place the checkbox on the footnote of my datagrid by using template and drag the checkbox to the footnote template.. do you have any solution according to my case? .. thanks Lucrecia
Hi, In which event you have placed your code? If in item databound then do you have a check condition as follows
If (e.Item.ItemType = ListItemType.Footer) Then Dim mControl as Control mControl=gridTest.findcontrol("chkFootNote") the result is mControl is nothing If (Not mControl Is Nothing) then ...... it have to be here!!!.... else ' it goes here ...... ;>( endif
End if Still if you have problem, can you post your code. Regards Ram
think you have to use the Ctype method for vb now you can use all the normal functions for the checkbox. (if mControl.Checked ==true) best regards, Stefan J.A.
in HTML page I use the following codes: when user click the checkbox --> oncheckchanged then call the "SelectAdd" function .. the selectadd function made in VB code .. Public Sub SelectAdd(ByVal sender As Object, ByVal e As System.EventArgs) Dim mControl
As Control Dim mHasControl As Boolean Dim myDataGridItem As DataGridItem Dim chkAdd As System.Web.UI.WebControls.CheckBox mHasControl = gridRights.HasControls() mControl = gridRights.FindControl("chkAddAll") If (Not mControl Is Nothing) Then ABCMessage("control
exist") For Each myDataGridItem In gridRights.Items chkAdd = myDataGridItem.FindControl("chkAdd") If chkAdd.Enabled = True Then chkAdd.Checked = False End If Next Else ABCMessage("no contriol ") End If End Sub I look forward to get the best solution from you
.. many hanks in advance Best Regards Lucrecia
but my problem is .. I cannot get the value of the checkbox (checked or unchecked)..FYI checkbox is located on the footnote of the datagrid.. please help Thanks Lucrecia
hi you must remember to use the Ctype function. becuse you can't convert the control to a checkbox control without stating what type of control it is :) like in c# (CheckBox)myDataGridItem.FindControl("chkAdd") Stefan
Lucrecia
Member
150 Points
41 Posts
Cannot get the value of my checkbox
Aug 01, 2003 01:10 AM|LINK
russnem
Contributor
7001 Points
1389 Posts
ASPInsiders
MVP
Re: Cannot get the value of my checkbox
Aug 01, 2003 03:50 AM|LINK
Lucrecia
Member
150 Points
41 Posts
Re: Cannot get the value of my checkbox
Aug 01, 2003 07:29 AM|LINK
Lucrecia
Member
150 Points
41 Posts
Re: Cannot get the value of my checkbox
Aug 01, 2003 08:24 AM|LINK
ramnanda
Participant
1195 Points
239 Posts
Re: Cannot get the value of my checkbox
Aug 01, 2003 08:44 AM|LINK
If (e.Item.ItemType = ListItemType.Footer) Then Dim mControl as Control mControl=gridTest.findcontrol("chkFootNote") the result is mControl is nothing If (Not mControl Is Nothing) then ...... it have to be here!!!.... else ' it goes here ...... ;>( endif End ifStill if you have problem, can you post your code. Regards Ramstefana99
Member
15 Points
3 Posts
Re: Cannot get the value of my checkbox
Aug 01, 2003 10:42 AM|LINK
CheckBox mControl = (CheckBox)gridTest.findcontrol("chkFootNote");think you have to use the Ctype method for vb now you can use all the normal functions for the checkbox. (if mControl.Checked ==true) best regards, Stefan J.A.Lucrecia
Member
150 Points
41 Posts
Re: Cannot get the value of my checkbox
Aug 01, 2003 01:03 PM|LINK
Lucrecia
Member
150 Points
41 Posts
Re: Cannot get the value of my checkbox
Aug 01, 2003 01:58 PM|LINK
stefana99
Member
15 Points
3 Posts
Re: Cannot get the value of my checkbox
Aug 01, 2003 01:58 PM|LINK