ListView FAQ
Please feel free to post additional questions in the comments section. I’ll get to them as I can and then link the help here.
- How do I get grid lines to show up in the ListView?
- How do I style a specific column in a ListView?
- How do I make it so that, instead of cutting off the text in my column when I shorten it, my text displays ellipsis?
- How do I make it so that my text wraps when I shorten my columns?
- How do I center something in my ListView column?
- How do I wrap text in a ListView header?
- How do I embed ListView Columns in another Column? (Columns with Categories)
- How do I style the ListView column gripper? (the gripper is also called a “splitter” and a “seperator”)
That’s all I got for now. Ask me some questions if you want more stuff.
If you’re looking for something more generic, check out my WPF Designers Guide to the ListView, which covers the broader topics in the ListView.
Ashwin:
my listview has a context menu (defined in XAML file using and also a double click event (opens up a new window on double clicking a row)
Problem 1:
When focus is on a row and the column edge is double clicked for the column to expand, the column expands but it also opens the window for the row which is selected. I dont want this to happen
problem 2:
30 January 2008, 5:23 pmRight clicking on the header should not open up the context menu (even if some item in the list view is selected)
Matthias:
Ashwin,
It sounds like the context menu is connected directly to your listView in the XAML. It sounds like you want it connected to your ListView Item. Try creating the ContextMenu as a resource and then hooking it up to your ItemContainerStyle. I’ll put up a post about this in the next couple days.
31 January 2008, 8:27 amkevin Mocha - WPF ListView FAQ:
[...] Friday, 22 February 2008 WPF ListView FAQ by Kevin Mocha http://www.designerwpf.com/2007/12/11/listview-faq/ [...]
22 February 2008, 7:02 am