Wednesday, March 20, 2019

[WPF, Datagrid] Is it possible to dynamically fill X columns of a Datagrid and depending on the content of a certain column, the rows/cells of the last column are set to either checkbox or textbox?

I got 3 columns with predefined headers and the 4th column should be a user input

Name | Type | Default Value | My Value (user Input)

Test1 | Bool | false | <Checkbox>

Test2 |String| "empty" | <Textbox>

Test3 | Bool | false | <Checkbox>

Test4 | Bool | false | <Checkbox>

The content of those columns is set by myDataGrid.Itemsource and bindings for each header (except My Value).

Depending on the Type displayed in column 2, I want column 4 to either represent a Textbox or a Checkbox for that particular row.

Is there a rather simple way to do this? Preferably directly in .xaml

[WPF, Datagrid] Is it possible to dynamically fill X columns of a Datagrid and depending on the content of a certain column, the rows/cells of the last column are set to either checkbox or textbox? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team