Sean Smyth
Sean Smyth

Reputation: 1581

How to remove the focused row when a gridview is initially loaded

I have a DevExpress gridview that loads on my screen. Initially, I do not want it to have a focus on any row. Only after a user selects a row do I want there to be focus. Is there a way to achieve this?

Upvotes: 0

Views: 8808

Answers (2)

Lusine Mkrtchyan
Lusine Mkrtchyan

Reputation: 59

with Mvvm pattern you can try this. I had the same problem and have solved it by overriding the OnPropertyChanged event of the GridView

protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) { base.OnPropertyChanged(e); this.ClearSelection(); }

Upvotes: 0

Ehsan
Ehsan

Reputation: 32701

if you have multiple rows selection option enabled on your grid you can call the

 gridView1.ClearSelection();

method on the gridview. However if it is not enables you have to call

gridView1.UnselectRow(5); 

method. You can read all such methods here

Upvotes: 1

Related Questions