>Hi everybody,
>
>I looked through several links but I'm still not clear as how to make the CheckBox field in a GridView to be easily clickable. In my current view it is
>
>
><asp:CheckBoxField DataField="Approved" HeaderText="Approved" SortExpression="Approved" />
which makes it readonly.
>
>I need to be able to simply click on this checkbox. Do you know how can I set up this field in a GridView?
>
Wrap a checkbox control in a template field. How you deal with the user checking/unchecking items depends on how you are planning on updating your data (eg. will it happen immediately when they check/uncheck it, or do they have to click on a "Submit" type button to save the changes).
If it's the second open you'll iterate over the grid, find the checkbox controls, compare against your data and update accordingly.
If it's the first, it gets a bit more complicated because you need to "attach" a value to the control so you know which row is firing the event (unfortunately it doesn't have a CommandName/CommandArgument which would make it easier). You can do things like set it in the Text property and attach a style to hide the text, or I think you can manually add a custom attribute as each checkbox is being databound in the grid using Checkbox.InputAttributes.Add() (using FindControl to get a reference to the checkbox).