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

[Solved] return to the current row

1 Answer 152 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michal Revivo
Top achievements
Rank 1
Michal Revivo asked on 10 Mar 2009, 08:23 AM
Hi

I update a row and save in the DB.
I populate the grid with new data.
How to return to the current row i updated in the RadGridView ?
The focus doesn't work only selected item

I successfully obtain the current dataSourceIndex

int dataSourceIndex ;
private void OnEditEnded(object sender, RecordRoutedEventArgs e)
        {
            DataRecord record = e.Record as DataRecord;
            dataSourceIndex = record.DataSourceIndex;
}

but how to focus on the selected item ?

 void client_GetOwnerCompleted(object sender, GetOwnerCompletedEventArgs e)
        {
            List<Owner> list = e.Result.OrderBy(Owner => Owner.Project).OrderBy(Owner => Owner.Customer).ToList();
            ownerGrid.ItemsSource = list;
            ownerGrid.SelectedItem = list[dataSourceIndex];
}

Thanks in advance
Fred

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 13 Mar 2009, 04:24 PM
Hello Fred,

I have attached a sample demonstrating a way to insert a new row , rebind the grid and return to it.

Hope this approach works for you. Let me know if you need further assistance.

Sincerely yours,
Pavel Pavlov
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.
Tags
GridView
Asked by
Michal Revivo
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or