I want to insert an icon/image in the column header with the header text and want to write code on the icon OnClick event. For more clarification, I want to design my datagrid as shown in the image attached and the Icon is marked in the red box. Please assist for this.
How can I get the column of the clicked image?
Hy Josh.
I have also a question about this sorting header.
I use a simple XamDataGrid in which I have some records and I want to sort them. When I click on the column header they are sorted ascending or descending, but a little arrow appears (to display the sorting order). When I go over that arrow the cursor changes to "hand" cursor and if I click the arrow for a new sorting nothing happens. Is this correct? Can I do something to sort the records even when the "hand" cursor it's displayed?
Thanks very much for help.
Nico
The sample that I linked you to demonstrates how to show/hide icons using data binding. Where those icons appear, whether in a data record or in a column header, is irrelevant. The technique can be used anywhere.
well, I want to insert icon/image in the header at runtime and not in the data rows. I will place different icon/image in the header at runtime and handle their click events. Is there a way, i can create a placeholder in the each field headers in XAML and can add controls in those placeholders at runtime. please assist and thanks for all responses.
Hi,
You don't need to do that from code. I showed how to do something similar here.
Josh