Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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