Click here to Skip to main content
15,901,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my data grid i have 20 columns.I enable autogeneratecolumns=true.Now one colums contains country names.now for each country i want to display the name and a image of that country.how to do this without defining columns manually???
Posted

1 solution

You can create a class for holding the country's details (name, image etc...):


C#
class Country
{
    // Add Some properties
}

add property for holding the country's details in your data and, add a DataTemplate for the Country class:


XML
<DataTemplate DataType="{x:Type mynamespace:Country}">
   <!-- ... -->
</DataTemplate>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900