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 :: c# unit test for throwing exception method 
Csharp :: expando object c# 
Csharp :: c# get string in parentheses 
Csharp :: unity ui button 
Csharp :: finding values in the registry 
Csharp :: c# get a value from value tuple list 
Csharp :: update table in C# 
Csharp :: remove scenedelegate 
Csharp :: c sharp list 
Csharp :: c# datagridview set column header alignment 
Csharp :: remove from list based on condition c# 
Csharp :: select range in list c# 
Csharp :: how-to-add-new-column-with-value-to-the-existing-datatable 
Csharp :: setting the parent of a transform which resides in a prefab 
Csharp :: even configuration custom errors page is not working asp.net MVC 
Csharp :: C# Blocks with statements 
Csharp :: update browserslist 
Csharp :: docker Test a Connection using Curl 
Csharp :: how to access path position variable in unity 
Csharp :: c# external ip 
Csharp :: Comparing Arrays using LINQ in C# 
Csharp :: how to fade c# form 
Csharp :: dictionaries in unity 
Csharp :: regex only letters and numbers c# 
Csharp :: begininvoke async c# 
Csharp :: update a file where there is a keyword c# 
Csharp :: c# get out of for loop 
Csharp :: web.config customerrors not working 
Csharp :: c# do while or 
Csharp :: count number of specific characters in string c# 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =