Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get selected item datagrid wpf

private void Row_DoubleClick(object sender, MouseButtonEventArgs e)
{
    ClassName classObj = dataGridName.SelectedItem as ClassName;
    string id = classObj.ID;
}
Comment

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; }
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: how get the user show mvc controller core 3.1 
Csharp :: how to get unique list in c# 
Csharp :: c# list.foreach 
Csharp :: Get the Photon Player GameObject 
Csharp :: c# read all lines from filestream 
Csharp :: how to insert into a list c# 
Csharp :: sorting a datatable in c# 
Csharp :: How to type custom backcolor on c# winform 
Csharp :: ray casting unity 
Csharp :: published net core did not have wwwroot 
Csharp :: c# add 2 arrays 
Csharp :: combobox selected name c# 
Csharp :: split lines c# 
Csharp :: c# create list of objects 
Csharp :: c# replace multiple characters 
Csharp :: c# type of string 
Csharp :: Print arraylist values to console unity 
Csharp :: destroy gameobject with tag unity 
Csharp :: vb.net get date minus one day 
Csharp :: exception handling in c# web api 
Csharp :: set the page that FormsAuthentication.RedirectFromLoginPage redirects to 
Csharp :: listview imagelist c# 
Csharp :: delete all rows from table linq 
Csharp :: fluent api 
Csharp :: c# shorthand if statement without else 
Csharp :: how to return a value in c# 
Csharp :: c# compare dateTime with string 
Csharp :: iterate through photon player gameobjects 
Csharp :: C# one line method 
Csharp :: linq c# object except two lists 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =