Home Forums WinForms controls Xceed Grid for WinForms get selected text Reply To: get selected text

User (Old forums)
Member
Post count: 23064

well you can do that using DataGridControl class. the following code snippet shows current selected item text in message box. its in C# but i hope you will be able convert it to VB.

private void DGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            DataGridControl dataGridControl = sender as DataGridControl;
            if (dataGridControl != null)
            {
                Xceed.Wpf.DataGrid.Row row = (Xceed.Wpf.DataGrid.Row)dataGridControl.GetContainerFromItem(dataGridControl.CurrentItem);
                Xceed.Wpf.DataGrid.Cell currentCell = row.Cells[dataGridControl.CurrentColumn.Index];
                if (currentCell != null && currentCell.HasContent)
                {
                    MessageBox.Show(currentCell.Content.ToString());
                }
            }
        }

regards

dEXtER2k

Imported from legacy forums. Posted by dEXtER.2k (had 353 views)