2020. 9. 3. 11:32ㆍDevelopment/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
'Development > WPF' 카테고리의 다른 글
[Telerik] Crystal Report ->Telerik Report 변환 (0) | 2020.07.15 |
---|---|
[Telerik] Textbox 입력 후 엔터 시에 버튼 이벤트 일으키기 (0) | 2020.07.08 |
[Telerik] SpreadSheet workSheet handling (0) | 2020.06.30 |
[Telerik] SpreadSheet Cell 서식 (0) | 2020.06.29 |
[Telerik] 그리드 셀s 복사/붙혀넣기 (0) | 2020.06.26 |