Click here to Skip to main content
15,847,427 members
Home / Discussions / WPF
   

WPF

 
QuestionRe: GridSplitter Conundrum Pin
Gil Yoder2-Feb-12 10:44
Gil Yoder2-Feb-12 10:44 
AnswerRe: GridSplitter Conundrum Pin
SledgeHammer012-Feb-12 12:40
SledgeHammer012-Feb-12 12:40 
GeneralRe: GridSplitter Conundrum Pin
Gil Yoder2-Feb-12 15:09
Gil Yoder2-Feb-12 15:09 
GeneralRe: GridSplitter Conundrum Pin
SledgeHammer012-Feb-12 15:37
SledgeHammer012-Feb-12 15:37 
GeneralRe: GridSplitter Conundrum Pin
Gil Yoder2-Feb-12 16:43
Gil Yoder2-Feb-12 16:43 
SuggestionRe: GridSplitter Conundrum Pin
Gil Yoder2-Feb-12 19:59
Gil Yoder2-Feb-12 19:59 
GeneralRe: GridSplitter Conundrum Pin
SledgeHammer013-Feb-12 8:17
SledgeHammer013-Feb-12 8:17 
Questionadding/removing ListView columns at runtime (revisited) Pin
Vincent Beek1-Feb-12 1:20
Vincent Beek1-Feb-12 1:20 
Some time ago I asked here the question how to code adding/removing columns to a Listview at runtime and 'binding columns to viewmodels'

SeldgeHammer came with this solution:

1) The WPF ListView doesn't support data binding on the GridViewColumnCollection out of the box. You can add support for this, not too difficult, but a little bit of work.
2) Once you have a WPF ListView that can support data binding on the GridViewColumnCollection, its just a matter of having your VM return a collection of columns.
3) Some gotcha's you'll run into:
a) a GridViewColumn can only be owned by one GridViewColumnCollection at a time, so you can't return a GridViewColumnCollection from your VM, you need to return an ObservableCollection<gridviewcolumn>.
b) defining a GridViewColumn in code with bindings is a major PITA, so you should devise a way to load them out of a XAML file where you'll again run into "issue a" where you can't share GridViewColumn's.

All these issues are overcomeable... basically what I ended up with was a GridViewEx class that supported two-way binding on the column collection. Remember, you are going to need to save column widths and column order .


I wanted to share a blog on this topic that I ran into the other day. I quite like the solution provided there. Sharing info never hurts right? Smile | :)

http://blogs.msdn.com/b/nathannesbit/archive/2009/03/13/developing-reusable-controls-with-the-model-view-viewmodel-pattern.aspx[^]
AnswerRe: adding/removing ListView columns at runtime (revisited) Pin
Abhinav S1-Feb-12 1:36
Abhinav S1-Feb-12 1:36 
GeneralRe: adding/removing ListView columns at runtime (revisited) Pin
Mycroft Holmes1-Feb-12 12:53
professionalMycroft Holmes1-Feb-12 12:53 
QuestionBinding list of items to IntemsControl in WPF Pin
rams231-Jan-12 0:14
rams231-Jan-12 0:14 
AnswerRe: Binding list of items to IntemsControl in WPF Pin
Wayne Gaylard31-Jan-12 1:10
professionalWayne Gaylard31-Jan-12 1:10 
GeneralRe: Binding list of items to IntemsControl in WPF Pin
rams231-Jan-12 1:36
rams231-Jan-12 1:36 
GeneralRe: Binding list of items to IntemsControl in WPF Pin
Wayne Gaylard31-Jan-12 1:39
professionalWayne Gaylard31-Jan-12 1:39 
GeneralRe: Binding list of items to IntemsControl in WPF Pin
Abhinav S1-Feb-12 17:26
Abhinav S1-Feb-12 17:26 
GeneralRe: Binding list of items to IntemsControl in WPF Pin
Wayne Gaylard1-Feb-12 20:06
professionalWayne Gaylard1-Feb-12 20:06 
QuestionFocusing on elements in MVVM Pin
mi_n30-Jan-12 23:42
mi_n30-Jan-12 23:42 
AnswerRe: Focusing on elements in MVVM PinPopular
Pete O'Hanlon31-Jan-12 0:03
subeditorPete O'Hanlon31-Jan-12 0:03 
GeneralRe: Focusing on elements in MVVM Pin
Pete O'Hanlon31-Jan-12 4:34
subeditorPete O'Hanlon31-Jan-12 4:34 
GeneralRe: Focusing on elements in MVVM Pin
Wayne Gaylard31-Jan-12 4:39
professionalWayne Gaylard31-Jan-12 4:39 
GeneralRe: Focusing on elements in MVVM Pin
Pete O'Hanlon31-Jan-12 4:47
subeditorPete O'Hanlon31-Jan-12 4:47 
GeneralRe: Focusing on elements in MVVM Pin
Wayne Gaylard31-Jan-12 4:56
professionalWayne Gaylard31-Jan-12 4:56 
GeneralRe: Focusing on elements in MVVM Pin
SledgeHammer0131-Jan-12 6:11
SledgeHammer0131-Jan-12 6:11 
GeneralRe: Focusing on elements in MVVM Pin
SledgeHammer0131-Jan-12 7:18
SledgeHammer0131-Jan-12 7:18 
GeneralRe: Focusing on elements in MVVM Pin
SledgeHammer0131-Jan-12 7:56
SledgeHammer0131-Jan-12 7:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.