Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Checkbox in LabelPresenter.

Last post 07-27-2008 22:06 by srozga. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-25-2008 10:57

    • dminnaar
    • Not Ranked
    • Joined on 02-07-2008
    • Points 100

    Checkbox in LabelPresenter.

    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.

    • Post Points: 20
  • 07-25-2008 14:50 In reply to

    Re: Checkbox in LabelPresenter.

    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,

    Curtis Taylor
    Senior Consultant
    Infragistics, Inc.
    • Post Points: 20
  • 07-26-2008 4:44 In reply to

    • dminnaar
    • Not Ranked
    • Joined on 02-07-2008
    • Points 100

    Re: Checkbox in LabelPresenter.

     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 :)

    • Post Points: 20
  • 07-27-2008 22:06 In reply to

    • srozga
    • Top 100 Contributor
    • Joined on 04-09-2008
    • Points 510

    Re: Checkbox in LabelPresenter.

     

    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>

    • Post Points: 5
Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems