How do you get the content of a single cell of a WPF toolkit DataGrid in C#?
By content I mean some plain text that could be in there.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Following what Phillip said – the
DataGridis usually data-bound. Below is an example where my WPFDataGridis bound to anObservableCollection<PersonName>where aPersonNameis comprised of aFirstNameandLastName(both strings).The
DataGridsupports automatic column creation so the example is quite simple. You’ll see that I can access rows by their index and get the value of a cell in that row by using the property name that corresponds to the column name.