[Telerik] select and current itme Synchronized problem

2020. 9. 3. 11:32Development/WPF

Prior to R2 2010 version, the current item was synchronized with the selected item. As a result, the first row of the GridView was selected initially. To prevent this, you need to set the IsSynchronizedWithCurrentItem property of RadGridView to False. Since the R2 2010 version, the IsSynchronizedWithCurrentItem is null by default. In this case, SelectedItem is synchronized with the CurrentItem only if a CollectionView is used as an ItemsSource.

 

 

WPF DataGrid | CurrentItem, SelectedItem and SelectedItems | Telerik UI for WPF

The SelectedItem property of RadGridView is used to access the data item of the selected row. It changes its value every time the selected row changes and exposes the object to which the row is bound. As it is a dependency property, you can easily bind it

docs.telerik.com

var addWell = new frmAddWellAssignment(_dataContext.SelectedUser.UserID.Trim(), false);

 var assignmentAdded = addWell.ShowDialog();

   if (assignmentAdded == true) {
                _dataContext.LoadAssignments();
            }

// RMH: Select the newly added item in the RadGridView

gvProperties.Items.Refresh();

var item = gvProperties.Items[gvProperties.Items.IndexOf(addWell.PropertyID)];

gvProperties.SelectedItem = item;

 

 

Set RadGridView Current/Selected Item in UI for WPF GridView - Telerik Forums

Join a community of over 2.6m developers to have your questions answered on Set RadGridView Current/Selected Item of UI for WPF GridView. New here? Start with our free trials.

www.telerik.com

//gets an instance of the current row

GridViewRowInfo row = radGridView1.CurrentRow;

//gets an instance of the current cell

GridDataCellElement cell = radGridView1.CurrentCell;

//gets or sets if the first row of radGridView1 is current or not

radGridView1.Rows[0].IsCurrent = true;

 

 

Basic Selection | RadGridView | Telerik UI for WinForms

Controls / GridView / Selection RadGridView provides you with a selection functionality, which allows the user to select one or more items (rows or cells) from the data displayed by the control. The selection mechanism can be controlled programmatically as

docs.telerik.com

 

Selecting Rows and Cells Programmatically | RadGridView | Telerik UI for WinForms

Controls / GridView / Selection You can select a single row programmatically by setting its IsSelected property to true: radGridView1.Rows[2].IsSelected = true; RadGridView1.Rows(2).IsSelected = True You can also select a single row by making it current: r

docs.telerik.com