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.
Unfortunately, activation email could not send to your email. Please try again.

Nonclickable Header style

Thread ID:

Created:

Updated:

Platform:

Replies:

7492 Sep 26,2003 12:10 PM Oct 3,2003 03:12 PM Windows Forms 11
loading
Tags: GridControl
Vladimir Arkhipov
Asked On September 26, 2003 12:10 PM

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!!!

Administrator [Syncfusion]
Replied On September 26, 2003 12:32 PM

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

Vladimir Arkhipov
Replied On September 29, 2003 06:26 AM

> 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?

Administrator [Syncfusion]
Replied On September 29, 2003 02:01 PM

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

Vladimir Arkhipov
Replied On September 29, 2003 03:55 PM

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

Administrator [Syncfusion]
Replied On September 30, 2003 08:17 AM

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

Administrator [Syncfusion]
Replied On September 30, 2003 03:20 PM

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

Vladimir Arkhipov
Replied On October 1, 2003 12:10 PM

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

Administrator [Syncfusion]
Replied On October 1, 2003 01:01 PM

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

Vladimir Arkhipov
Replied On October 1, 2003 03:12 PM

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

Administrator [Syncfusion]
Replied On October 3, 2003 11:40 AM

> 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

Vladimir Arkhipov
Replied On October 3, 2003 03:12 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;