Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am trying to create a control with number of columns like ListView-GridView. But I need to display data in any of the one columns.

Say I have a ListView of 4 columns. I have a data object which can be displayed in the any of the 4 columns at runtime not like all the columns

How can I achieve it? I started have already customized the style of the ListView but not helping. I am trying to create a control like Gantt Chart. I know there are controls in market and codeplex but I need to do this myself as it request more customization toward my business.

Thanks in Advance
Posted
Updated 20-Sep-10 17:38pm
v2

One way could be to build your underlying collection (the one you bind your listview to) in such a way that the data object can then be in whatever column / position you want it to be in.

In this case, your listview need not worry about what needs to be displayed where, it just does the binding. The way you build your collection becomes important.
 
Share this answer
 
Comments
Venkatesh Mookkan 21-Sep-10 0:22am    
Thank for your suggestion Abhinav.

I have a data object having start time. Each column has a hour time period. According to the start time in the data object I need to show the data in correct time period. Is there a way that I could Colspan the ListView columns?
Abhinav S 21-Sep-10 0:30am    
Not sure, but maybe http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/cddee56d-8283-44e5-9f14-c4cbb0da2b87 can help you?
Venkatesh Mookkan 21-Sep-10 0:35am    
I have already see that. Actually I have found the solution and I so close the find the way. Thanks for your time Abhinav.
Abhinav S 21-Sep-10 0:42am    
Thanks for posting the solution here. Hopefully this will help someone in the future too.
I have found the solution. I need to customize the Style of ListViewItem where I can replace the GridViewRowPresenter to ContentPresenter or something which would help to show the row in colspan type.
 
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