Vano Maisuradze
Vano Maisuradze

Reputation: 5899

How to select Dev Express's WPF GridControl row?

I want to select GridControl's row, after data binding:

  1. Get selected row
  2. Bind GridControl with new Data
  3. Select GridControl's row

I'm trying so, but with no success:

int selectedRowhandle = gridControl1.View.GetSelectedRowHandles()[0];

gridControl1.DataSource = "DataSource...";

gridControl1.View.SelectRow(selectedRowhandle);

How can I do this in DevExpress.Xpf.Grid.GridControl?

Thanks.

Upvotes: 1

Views: 12244

Answers (1)

Vano Maisuradze
Vano Maisuradze

Reputation: 5899

I only changed this:

gridControl1.View.SelectRow(selectedRowhandle);

to

gridControl1.View.FocusedRowHandle = selectedRowhandle;

and it works.

Upvotes: 2

Related Questions