Hi there. I need some help please.
I add a unbound field to my grid to allow the user to enable/disable an option. I want to add a checkbox to the label and when the user checks/unchecks that checkbox I want to check or uncheck all the rows in the grid.
Can you please help me?
In code I add the selecor field to the grid:
Dim SelectorField As New UnboundField SelectorField.DataType = GetType(Boolean) SelectorField.Column = 0 SelectorField.Settings.LabelWidth = 20 SelectorField.Settings.CellWidth = 20 SelectorField.Settings.AllowEdit = True pLayout.Fields.Add(SelectorField)
Thanks.
I have done this by overwriting the default control template for the Label Presenter.
<Style TargetType="{igDP:LabelPresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{igDP:LabelPresenter}">
<CheckBox Checked="CheckedHandler" Unchecked="UncheckedHandler" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Hi Curtis.
So far I managed to add the unbound field to the grid and I raise an event when the checkbox on a row is checked and unchecked. I also have a property that allows the developer to check and uncheck rows in code.
Now all I need is to add another checkbox onto the screen that the user can use as a "quick" check all or uncheck all. The best place to add such a checkbox would be the in the LabelPresenter for the unbound checkbox field.
How do I define a LabelPresenterStyle that only contains an XamCheckBox? And how do I hook into the checked and unchecked events for that XamCheckBox?
Thank you very much :)
Did you want to know the best way to assign a checkbox to an unbound field or how to check/uncheck all the checkboxes in the grid when the user checks or unchecks one checkbox? Would this checkbox be in the header which would be a quick way to uncheck all the checkboxes in a column?
Thanks,