In a situation where I have a DataGrid which is being bound to a List of a specific class and the DataGrid has AutoGenerateColumns set to true, I found myself needing a way to hide some of the columns which I did not want to present to a user. Below is an example of binding […]
Read More →Archive for May, 2012
How to capture double click event in Data Grid row using WPF and C#
There are a number of name differences between a windows form and a WPF program. For example, in a windows form program the event which is triggered when a user double-clicks on a data grid is called Doubleclick. The event in a WPF program is called MouseDoubleClick. Therefore the way to implement, program or add […]
Read More →Get column value from DataGrid, NewItemPlaceholder, WPF, DataRowView and exception using C#
The way a problem is approached can have some serious consequences. Take for example the task I had to add some data to a DataGrid in WPF and allow a user to select the rows. When the rows were selected I would capture the details and put them into a form where they could be […]
Read More →How to add double quotes to a string
I needed to save an XML formatted file as a string which required double quotes around the attributes. The below code shows how to add double quotes to a string. string data = “<customer name=\”Ben Perkins\” class=\”Customer\”> <property name=\”Id\” /><property name=\”Address\” /> <property name=\”Occupation\” /> <property name=\”Remark\” /></ customer >”; Notice […]
Read More →