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

Diseable Highlighting Cell if not selected

1 Answer 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Abdelkrim
Top achievements
Rank 1
Abdelkrim asked on 30 Oct 2012, 02:42 PM
Helo,

I have severals radgrid superposed (like picture ) and 
I want to remove border of cell (highlited) in a radgrid if the cell is not selected  to keep only one cell highlited (selected cell)
I use a CellSelect mode

I tried this code but the result is ugly, Because of original cell border (blue) is deleted Also

RadGridView_ViewCellFormatting(object sender, CellFormattingEventArgs e)
    {
     GridDataCellElement dataCell = e.CellElement as GridDataCellElement;
      if (dataCell != null)
      {
          Color borderColor = Color.Transparent;
        if (!dataCell.IsSelected)
          borderColor = Color.Red;
         
         dataCell.BorderColor = borderColor;
      }
        
  }

Thank you for your help,

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 02 Nov 2012, 08:16 AM
Hi Abdelkrim,

Thank you for writing.

I am afraid I do not fully understand your requirement. If you want to have only the selected cell highlighted and the rest of the cells to remain you can set the EnableHotTracking property to false. This will stop the mouse movement over the cells to highlight the entire row. Also as you have mentioned you have to have the SelectionMode to CellSelect. 

If this is not what you want, I would kindly ask you to send me a more detailed explanation of your case. A screenshot or a sketch would also be useful.

Looking forward to your reply.
 
Kind regards,
Ivan Petrov
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
GridView
Asked by
Abdelkrim
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or