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

Nonclickable Header style

I need something similar to MS ListView HeaderStyle property "Nonclickable". I tried everithing e.g. this.gridControl1.RowStyles[0].Clickable = false; or gridBaseStyle2.StyleInfo.Clickable = false; But everitime my grid control has clickable headers (e.g. in XP it highlights when mouse over) Please help!!!

11 Replies

AD Administrator Syncfusion Team September 26, 2003 04:32 PM UTC

Set them .Enabled = false and/or also .Themed = false Stefan


VA Vladimir Arkhipov September 29, 2003 10:26 AM UTC

> Set them .Enabled = false and/or also .Themed = false > > Stefan Thanks, I tried this too. I can make header flat, but I cannot change lines color from black to dark gray, and I don't like flat header anyway I want it to be 3D. So the question is still open - is it possible to have non-clickable but good looking column (row) header in the Grid Control?


AD Administrator Syncfusion Team September 29, 2003 06:01 PM UTC

Hi Validmir, i looked into it again. The suggestion with .Enabled = false was not correct since the header will event then stile raise a cell clicked event. What you need to do right now, is to derive from the grid class and override the virtual OnCellClick method and then don't call the base class version. This will avoid the grid executing the default OnCellClick code. The header cell type currently does not check the Clickable property in order to determine if it should support Clicking. I have made a note to add support for this. Stefan


VA Vladimir Arkhipov September 29, 2003 07:55 PM UTC

Stefan, I tried OnCellClick and OnCellMouseHoverEnter too, but it does not work. I mean visually I still see clicking header buttons. I want to have static 3D header, XP style, and header has to be unclickable (there are 2 things that make header clickable: XP highlighting on mouse over and clickable button). Please help me disable those visual effects. Thanks, Vladimir


AD Administrator Syncfusion Team September 30, 2003 12:17 PM UTC

I'll create a sample for this and post it here. Should be able to get that done before end of the week. Stefan


AD Administrator Syncfusion Team September 30, 2003 07:20 PM UTC

Attached find a modified version of the GridHeaderCellRenderer source file. To use that cell type in your project you should change its namespace first and then register it as cell type in the grids CellModels collection. You will still need to override OnCellClick because there is currently some code in the grid that always forces CellClick being raised no matter if Clickable was set or not. This is because Clickable was originally intended for cell buttons (e.g. the dropdown button in a combobox). I will make changes in the source base so that you can set Clickable false and then don't get a CellClick event. These changes should become available with 1.6.1.8 build in a week or two. Then you will also not need your own header rendere any more. Stefan


VA Vladimir Arkhipov October 1, 2003 04:10 PM UTC

Stefan, Thank you. New GridHeaderCellRenderer works! I have 3D header, XP style, and no XP highlighting and no button press for non-clickable headers. But... There is still focus rectangle and cursor change for non-clickable headers even after OnCellClick is overriden. Regards Vladimir


AD Administrator Syncfusion Team October 1, 2003 05:01 PM UTC

To avoid focus set style.Enabled = false To avoid changing cursors change Model.Options.AllowSelection Stefan


VA Vladimir Arkhipov October 1, 2003 07:12 PM UTC

Thanks! (50%:) > To avoid changing cursors change Model.Options.AllowSelection - works fine! > To avoid focus set style.Enabled = false - does not work for headers Vladimir


AD Administrator Syncfusion Team October 3, 2003 03:40 PM UTC

> Thanks! (50%:) > > To avoid changing cursors change Model.Options.AllowSelection - works fine! > > > To avoid focus set > style.Enabled = false - does not work for headers > > Vladimir I checked it out but it works for me. Are you doing it as follows? this.gridDataBoundGrid1.BaseStylesMap["Header"].StyleInfo.Enabled = false; this.gridDataBoundGrid1.BaseStylesMap["Header"].StyleInfo.Clickable = false; this.gridDataBoundGrid1.ThemesEnabled = true; Stefan


VA Vladimir Arkhipov October 3, 2003 07:12 PM UTC

Thanks, it works now! I tryed: this.gridControl1.RowStyles[0].Clickable = false; this.gridControl1.RowStyles[0].Enabled = false;

Loader.
Up arrow icon