Quantcast
Viewing all articles
Browse latest Browse all 4

cell single clik for data grid wpf

You could add the CheckBox to a DataGridTemplateColumn in the XAML markup:

<DataGrid><DataGrid.Columns><DataGridTemplateColumn><DataGridTemplateColumn.CellTemplate><DataTemplate><CheckBox Checked="CheckBox_Checked_1" Unchecked="CheckBox_Unchecked_1"></CheckBox></DataTemplate></DataGridTemplateColumn.CellTemplate><DataGridTemplateColumn.CellEditingTemplate><DataTemplate><CheckBox Checked="CheckBox_Checked_1" Unchecked="CheckBox_Unchecked_1"></CheckBox></DataTemplate></DataGridTemplateColumn.CellEditingTemplate></DataGridTemplateColumn></DataGrid.Columns></DataGrid>

This column will then be added next to the automatically generated ones.

You could then implement the CheckBox_Checked_1 event handler to save the changes but how to do save a the contents of a DataTable to a file is another non-WPF topic. You could for example use the WriteXml method of the DataTable: http://stackoverflow.com/questions/1511923/dump-c-sharp-datatable-to-a-file

Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

 


Viewing all articles
Browse latest Browse all 4

Trending Articles