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

UWP getting value from a cell in a selected row

1 Answer 163 Views
Miscellaneous
This is a migrated thread and some comments may be shown as answers.
Johnathan
Top achievements
Rank 1
Johnathan asked on 06 Sep 2017, 01:09 PM
i was hoping you guys could help me out. I am binding to my raddatagrid through a data model from a sql query through a wcf service. I need to get the value of a specific cell when a single or multiple rows are selected on button press.

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 08 Sep 2017, 09:13 AM
Hi Johnathan,

Please have a look at the following article from our documentation page -  Get Row Item and DataGridCellInfo Item from a Physical Point. You can apply the following modification to use it within the Tapped event of the DataGrid:

private async void grid_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) {
    var physicalPoint = e.GetPosition(sender as RadDataGrid);
    var cell = (sender as RadDataGrid).HitTestService.CellInfoFromPoint(physicalPoint);
 
    if (cell != null)
    {
        var dialog = new MessageDialog(string.Format(cell.Column.Header.ToString()), "COLUMN HEADER: " );
        await dialog.ShowAsync();
    }
}


Regards,
Stefan Nenchev
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Miscellaneous
Asked by
Johnathan
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or