0
votes

I have an MyGridControl derived from DataGrid.

I want to put 2 Command buttons on the right top corner (Not in the Grid, above the Grid) of the Grid so that these 2 buttons will appear for each of the Grid i will put on the WPF window.

How can i write a Control template for it?

Or Is there any other way of doing it?

One important thing, I can do it using Custom Control but i want MyGridControl should be derived from DataGrid not UserControl, so that all DataGrid properties can be easily exposed to my Window.

1

1 Answers

0
votes

I didnt get this...

One important thing, I can do it using Custom Control but i want MyGridControl should be derived from DataGrid not UserControl, so that all DataGrid properties can be easily exposed to my Window.

Going back to your query, you could create a usercontrol and "adorn" the Grid in that user control in a GroupBox and override its HeaderTemplate to host two buttons to the top-right coner

Or

You could affix a popup to top right corner of the grid to host the buttons.