1

I have the need to show RowDetails in the WPF DataGrid when the user performs an action outside of the grid. The thing is though, I need to be able to switch out exactly what the RowDetails will be based on that. For example, if the click Add, I want to show RowDetails below Row of type AddRowDetailControl, and if they choose Edit, I would want to show a different control under the same row instead. Is this possible?

1 Answer 1

1

You'll have to create the datatemplate of your RowDetails dynamically based on what your requirement is. Inside the datatemplate you can put the controls you need.

Have a look here: http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx

Sign up to request clarification or add additional context in comments.

3 Comments

You don't have to create the templates dynamically, you can prepare two templates in your resource dictionary, and dynamically (perhaps using a template selector) switch between them.
@Aviad - That is an even better solution! :)
Thanks, I'm going to use the template selector along with the method to set the visibility of the row details. SetDetailsVisibilityForItem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.