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

Checkbox in Header - GridDataBoundGrid

Hi,

I was able to put a checkbox control in the column header using the following example - http://help.syncfusion.com/ug_73/gridwin/HowToPutACheckBoxInAHeaderCellInAGridControlOrGridDataBoundGrid.html

But how do I preserve the style of the header columns - backcolor, border, etc. so it looks similar to the other header cells?

Thanks,

Gurbhej

3 Replies

LS Lingaraj S Syncfusion Team October 5, 2009 01:56 PM UTC

Hi Gurphej,

Thank you for your interest in Syncfusion products.

If you want to get a Header style in GridDataBoundGrid, then please try using below way to achieve your requirement.

Refer the code below:

int colIndex1 = this.gridDataBoundGrid1.Binder.NameToColIndex("Column2");
Color color=this.gridDataBoundGrid1[0,colIndex1].BackColor;
GridBorder border = this.gridDataBoundGrid1[0,colIndex1].Borders.All;


Please let me know if you have any queries.

Regards,
Lingaraj S.


GD Gurbhej Dhillon October 5, 2009 04:26 PM UTC

This doesnt seem to resolve the issue I am having. Please see attached screenshot. I want to have the header cell with the checkbox to look exactly like the header with the text in it.



headerCell_34b95d33.zip


LS Lingaraj S Syncfusion Team October 6, 2009 01:10 PM UTC

Hi Gurbhej,

Thank you for the update.

If you want create CheckBox in column header with GridVisualStyle, it can be done by handling CustomHeaderCell in GridDataBoundGrid as shown in attached sample.

Refer the sample from below link:
http://files.syncfusion.com/support/samples/Grid.Windows/7.3.0.20/Forums/HeaderCheckBox.zip

Please let me know if you have any queries.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon