Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 25, 2013 03:10 PM by danmbuen
Sep 06, 2006 10:15 AM|LINK
I am using one gridview to display company name as text column and approval column as checkboxfield. If checked I have to approve corresponding company to our list.In the gridview control's Rowcommand event if "e.commandName" is update I have to update.For
this purpose I need to get the checkbox status. How can I access checkboxfield value there. Please help me. It will great kind of yoy.
Sep 06, 2006 03:51 PM|LINK
Dim row As GridViewRow =
CType(CType(e.CommandSource, Control).Parent.Parent, GridViewRow)
Dim chkBox As checkbox =
This should give you access to your control.
Sep 07, 2006 06:45 AM|LINK
Thanks a lot for your immediate reply. I couldn't use following code since checkboxfiled doen't have ID attribute.
Do you have any other solution for this?
Thnks in advance for your reply
Sep 07, 2006 01:39 PM|LINK
Sep 14, 2006 03:56 PM|LINK
Here I am using Checkbox field as column not checkbox control under template field. I had tried to add ID property, but checkbox field doesn't support to set ID attribute. I converted checkbox field column to template and solved my issue. But still I wanted
to know If we use Checkbox field how can we access its propery at run time. could you please help me?, I will be gratefull to you.
Thanks & regards
Sep 14, 2006 04:06 PM|LINK
Try doing something like this:
Dim r As GridViewRow
For Each r
Dim chkBox As CheckBox =
You may have to play around with the index inside the control property depending on wether or not you have any other controls in that column.
Hope this helps.
Oct 07, 2006 01:45 PM|LINK
Oct 11, 2006 11:01 AM|LINK
[quote user="varsha_sinyal"]How to access value of a column whose visible property is set to false in grid view control ?
You can access the value of the control used in GridView by:
foreach (GridViewRow gridRow in GridView.Rows)
CheckBox chk = (CheckBox)gridRow.FindControl("yourChkBox");
and you can access the column by its index :
GridView.Columns.Visible = true;
Aug 20, 2007 10:02 PM|LINK
Dim ck as CheckBox = CType(GridView1.Rows(0).Cells(0).Controls(0), CheckBox)
If ck.Checked = True Then
YourCheckBox.Checked = True
YourCheckBox.Checked = False
Aug 02, 2009 03:54 PM|LINK
Here's how I do it:
to access the checked property of a asp:CheckBoxField
in a gridview:
cbActive.Checked = ((CheckBox)GridView1.Rows[r].Cells.Controls).Checked;
where r is my rowIndex.