Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Add DataTemplate programmatically to show show DataGrid/ListView columns

$
0
0

Hello,

In my application, i want to show some properties from an object in a ListView or DataGrid. I want to programatically add a DataTemplate which will show some selected columns in the code file.

Can i create a derived custom control of type ListView/DataGrid which will show the selected columns in the view. I will bind the object as a DatContext in the XAML.

How i can do this?

Thanks in advance,

IamHuM


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>