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

Cell Focus

1 Answer 274 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 23 May 2012, 05:06 PM
I'm trying to prevent cells from being focused.  I saw this piece of code on another forum post:

if (gridCellElement != null)
{
 if (gridCellElement.IsCurrent)
 {
  gridCellElement.IsCurrent = false;
  gridCellElement.IsCurrentColumn = false;
 }
 else
 {
  gridCellElement.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
  gridCellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
 }
}

This works until I start editing a cell.  I saw something about creating a custom theme, but I do not know how to do that.  I am really hoping that there is a property I missed that says "don't draw cell focus", but I can't find it.

1 Answer, 1 is accepted

Sort by
0
Boryana
Telerik team
answered on 28 May 2012, 11:16 AM
Hi Liru,

Thank you for writing.

As far as I understand your requirements, you would like to select a RadGridView row without indicating the current cell. The best approach to achieve the desired outcome is to modify the used theme, so that the selected cell has no visual indication. You will need to load the theme you are using in our Visual Style Builder tool and navigate to RadGridView >> RadGridViewElement >> GridTableElement >> GridDataRowElement  in the Controls Structure pane. Further, you will need to remove the repositories of the CellElements, so that the current cell behaves like a cell in the current row.

Attached you will find a modified tssp of the ControlDefault theme and a sample project that demonstrates my suggestion. In case you are not using the ControlDefault theme and you experience difficulties customizing the tssp on your own, please contact me back. Please mention the theme you are using, so that I can provide you with adequate assistance.

I hope my answer is helpful. Let me know if you need further assistance.

Regards,
Boryana
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Michael
Top achievements
Rank 1
Answers by
Boryana
Telerik team
Share this question
or