Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
205
CheckBoxColumn Check All Header
posted

Hi! I got the following situatino:

I derivated XamGrid to make my custom grid and I create  dinamically some column. One of then is a CheckBoxColumn that binds into a property named "Selecionado".

What I need is to create in the header of this column a checkbox that check/uncheck all checkboxes in this column.

Pretty simple, but I create this template dinamically using an StyleWrapper I build. In my style dictionary i declared a DataTemplate that contais a checkbox, as shown above.

<DataTemplate x:Name="ucGridPermissaoColSelecionadoHeaderTemplate" >

<CheckBox x:Name="ckbTodos" HorizontalAlignment="Center" />

 

 

 

 

</DataTemplate>

When my grid is instatiated, I do the following, where StyleWrapper.GetItem<DataTemplate> return the DataTemplate i`ve shown before. How do I do that???

 

 

CheckBoxColumn colSelecionado = new CheckBoxColumn();

colSelecionado.HeaderTemplate =

 

StyleWrapper.GetItem<DataTemplate>("ucGridPermissaoColSelecionadoHeaderTemplate");

Parents
No Data
Reply
  • 21382
    posted

    I am not sure what the question is here. 

     

    Does your GetItem return a valid DataTemplate?  Are you not getting that value?   Could you clarify what you are asking?

     

    The DataTemplate as written isn't going to do much, just be Checkbox.  You would need to attach an event handler (or two) to it to function.

Children