Answers for "get value row selected datagrid c# wpf"

C#
0

c# datagridview get selected row values

int rowindex = dataGridView1.CurrentCell.RowIndex;
int columnindex = dataGridView1.CurrentCell.ColumnIndex; 

dataGridView1.Rows[rowindex].Cells[columnindex].Value.ToString();
Posted by: Guest on August-28-2021
0

get selected item datagrid wpf

private void Row_DoubleClick(object sender, MouseButtonEventArgs e)
{
    ClassName classObj = dataGridName.SelectedItem as ClassName;
    string id = classObj.ID;
}
Posted by: Guest on December-20-2021
0

wpf datagrid get selected items

private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        try
        {
            var row_list = (Item)dg.SelectedItem;
            listblock1.Content = "You Selected: " + row_list.FirstName + " " + row_list.LastName;
        }
        catch { }

    }
    public class Item
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
Posted by: Guest on February-07-2022

C# Answers by Framework

Browse Popular Code Answers by Language