This is a migrated thread and some comments may be shown as answers.

Disable Row/Cell Highlighting

5 Answers 712 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Peter Codrington
Top achievements
Rank 1
Peter Codrington asked on 01 Oct 2007, 04:43 PM
Hi All,

How can I get the grid not to highlight the row or cell when hovering with the mouse?

Thx

5 Answers, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 02 Oct 2007, 12:16 PM
Hi Peter Codrington,

Currently this can be achieved only by modifying the corresponding Theme. Here is a way to do that:
  1. Open the RadControls for WinForms example application which is installed on your machine and go to grid examples -> Theming.
  2. Select the desired theme from the "Theme" drop down button.
  3. Open the "Theme Builder" app from the link button on the bottom left.
  4. Select the "GridRowElement" element in the treeview on the left
  5. Remove or modify accordingly all states from the lower tabs that involve the "IsMouseOver" condition. Optionally you can also do that with the "GridHeaderRowElement" states, and so on.
  6. Save the theme.
  7. Load it your app using the ThemeManager component.
I've actually done that for you with the Telerik and Vista themes and I am attaching the files.

We know this isn't the most straight-forward approach to achieving such a simple and quite common scenario so we plan to add simpler API for the next version whenever possible.

 
Kind regards,
Mike
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Support
Top achievements
Rank 1
answered on 17 Feb 2009, 09:42 AM
Hi,

Has there been any progress with this?  We want to be able to turn selection on/off dependent on the context.  Changing the Theme seems like an overcomplicated solution!

Thanks

Richard
0
Jack
Telerik team
answered on 17 Feb 2009, 09:58 AM
Hi Education Direct,

Yes, you should just set the EnableHotTracking property to false. This will disable the highlighting when hovering a row in RadGridView. Please write us if you have any other questions.

Best wishes,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
answered on 12 Jun 2015, 05:39 PM

How would I stop ROW Highlighting all together. I don't want a row to be highlighted at all, weather it was selected or not. 

 

Thanks

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Jun 2015, 03:01 PM
Hello Mark,

Thank you for writing.

In addition to setting the EnableHotTracking property to false, you can use the CellFormatting/RowFormatting events in order to disable the selected/current state indication to cells/rows:
private void radGridView1_RowFormatting(object sender, Telerik.WinControls.UI.RowFormattingEventArgs e)
{
    e.RowElement.DrawFill = false;
    e.RowElement.DrawBorder = false;
}
 
private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    e.CellElement.DrawFill = false;
    e.CellElement.BorderWidth = 1;
    e.CellElement.DrawBorder = true;
    e.CellElement.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.SingleBorder;
    e.CellElement.BorderColor = Color.FromArgb(209, 225, 245);
    e.CellElement.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid;          
}

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Peter Codrington
Top achievements
Rank 1
Answers by
Mike
Telerik team
Support
Top achievements
Rank 1
Jack
Telerik team
Mark
Top achievements
Rank 2
Bronze
Iron
Veteran
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or