Answers for "wpf datagrid get value from row"

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

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

Code answers related to "wpf datagrid get value from row"

C# Answers by Framework

Browse Popular Code Answers by Language