We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to set check box on the columns

Hi,

I'd like to know how to set check box on the columns and set edit mode for only the check box colums.

Regards,
Kenji

Attachment: Figure01_f12ab1fc.zip

1 Reply

VK Vinish Kumar K Syncfusion Team February 18, 2014 04:12 AM UTC

Hi Kenji,

Thank you for you interested in Syncfusion products.

Query

Check box in Grid control

We have analysed the reported query in our end. You can set the cellType as checkbox for particular column using the below code.

if(e.ColIndex == 2)

     {

 

           e.Style.CellType = "CheckBox";

                 e.Style.CellAppearance = GridCellAppearance.Raised;

                 e.Style.Enabled = true;

           }

      }

Please refer the below UG links.

http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/howtoputacheckboxina.htm

http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/checkbox.htm

Readonly for one column 

We have a property “ReadOnly” to set the cells as non-editable. Please refer the below codes.

// Changes cannot be made to the cell (1,1).

this.gridControl1[1,1].ReadOnly = true;

Or use the query cell info event for this.

 private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

    {

           

        if(e.ColIndex > 2)

        {

            e.Style.ReadOnly = true;

        }

    }

Please refer the below UG links.

http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/howtomaketheparticul.htm

http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/makingachangetoaread.htm

Please let me know if you have any concerns.

Regards,

Vinish K.


Loader.
Live Chat Icon For mobile
Up arrow icon