UWP getting value from a cell in a selected row

2 posts, 0 answers
  1. Johnathan
    Johnathan avatar
    2 posts
    Member since:
    Aug 2017

    Posted 06 Sep 2017 Link to this post

    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.
  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    665 posts

    Posted 08 Sep 2017 Link to this post

    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
Back to Top