Home Forums WPF controls Xceed DataGrid for WPF How to bind to column visible property

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24497 |

    I would like to bind a menuitem in the contextmenu for the datagrid to the visible property of a certain column. How would I do this in XAML?

    <xcdg:DataGridControl.ContextMenu>
    <ContextMenu>
    <MenuItem Unchecked=”MenuItem_Unchecked” Checked=”MenuItem_Checked”
    IsChecked=”?????????????????” IsCheckable=”True” />
    </ContextMenu>
    </xcdg:DataGridControl.ContextMenu>

    Imported from legacy forums. Posted by curelom (had 608 views)

    Xceed Support
    Member
    Post count: 5658

    Hmmm, this one is definitely harder than it might look at first!!!

    I’m gonna dig a little around that one… But at the moment, I have no simple solution…

    For the moment, my recommendation would be to stick with handling the Checked/Unchecked events and leave the “IsChecked” property floating (but ensure that its default value maps with the Column`s Visible value.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 333 views)

    User (Old forums)
    Member
    Post count: 23064

    How about

    {Binding ElementName=grid, Path=Columns[yourColumnNameHere].Visible}

    Imported from legacy forums. Posted by nat (had 3102 views)

    User (Old forums)
    Member
    Post count: 23064

    Have you guys found a way to do this?

    Imported from legacy forums. Posted by Daniel (had 844 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.