2

I wish to add one column which has a unchecked checkbox in it. This is used so the user can select multiple rows.

datatable.Columns.Add(new DataColumn("Selected", typeof(bool)));

if above datatable is used in a normal DataGridView it shows a checkbox instead of a bool. However when used in a SPGridView it will just show me true/false.

datatable.Columns.Add(new DataColumn("Selected", typeof(CheckBox)));

Above datatable shows System.Web.UI.WebControls.CheckBox instead of the checkbox or the true/false value.

So how van i create a column which only shows a checkbox in each row. And how can i add a CheckBox to the column header so the user can select that one for all rows in the SpGridView.

0

Check link below. It Shows How to add Check box in SPGridView.

http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/adding-checkboxes-in-sharepoint-gridview-spgridview/

and check this link which shows that how to add header Check box in SpGridView.

CheckBox header to select all checkBoxes in SPGridView

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.