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 disable a column Header

Hi ,
how can i disable column header in a cell which is a DropDownList.

5 Replies

AD Administrator Syncfusion Team December 6, 2006 05:04 AM UTC

Hi Pawan,

You can access the GridDropDownGridListControlCellRenderer and set the ListPart.ShowColumnHeader property to turn OFF/ON the dropdown list column header in a grid cell. Here is a code snippet to show this.

GridDropDownGridListControlCellRenderer cr = this.grid.TableControl.CellRenderers["GridListControl"] as GridDropDownGridListControlCellRenderer;
cr.ListControlPart.ShowColumnHeader = false;

Best Regards,
Haneef


PA Pawan Adur December 6, 2006 06:05 AM UTC

but i cant do this with GroupingGridControl..


>Hi ,
how can i disable column header in a cell which is a DropDownList.


AD Administrator Syncfusion Team December 6, 2006 06:30 AM UTC

Hi Pawan,

Please try the attached sample and let me know if you are trying something different.
GGCHideDropDownColumnHeader.zip

Best Regards,
Haneef


PA Pawan Adur December 6, 2006 06:52 AM UTC

hi haneef,
the example was good.but i have DropDownList is all the cells ..but i need 2 disable only two on them ..



>Hi Pawan,

Please try the attached sample and let me know if you are trying something different.
GGCHideDropDownColumnHeader.zip

Best Regards,
Haneef


AD Administrator Syncfusion Team December 6, 2006 09:21 AM UTC

Hi Pawan,

You can handle the TableControlCurrentCellShowingDropDown event and set the ListControlPart.ShowColumnHeader property for required cells in a grid. Here is a code snippet.

private void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if( cc.ColIndex == 1 && cc.RowIndex == 5)
{
GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
if( cr != null)
cr.ListControlPart.ShowColumnHeader = false;
}
}

Modified Sample: GGCHideDropDownColumnHeader.zip

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon