Welcome to the Xceed Community Sign in | Join | Help
Community Search  

enabling the Combobox with respect to checkbox

Sort Posts: Previous Next
  •  04-30-2008, 4:01 AM Post no. 11854

    enabling the Combobox with respect to checkbox

    Hello,

    I have a requirement with in the xceedgrid.

    enabling the Combobox with respect to checkbox -click.

    There is a 'checkBox' in a dataTemplate  and a 'comboBox(Dropdown control)' in another datatemplate.

    Now the requirement is , if the checkbox is Ckecked/clicked the Combobox should be enabled to 'True'

    or

    if the checkbox is Unchecked the combo box should be enabled to False.

    and this should be written in XAML only  with out using any code in code-behind .

    As the checkbox and comboBox appear for each row of the grid under two different columns.

    Can i know how to get access a control from one datatemplate to another datatemplate.or Is it possible.

    In page_load , the combobbox is enabled to false and checkbox is enabled to true ,In each DataRow. 

    As the requirement is very urgent pleace reply as soon as possible.


    Thankyou.

  •  04-30-2008, 6:43 AM Post no. 11856 in reply to 11854

    Re: enabling the Combobox with respect to checkbox

    I've got something similar I've had to solve, it might help you to find a solution.

    I have a row with a checkbox that has to be enabled or disabled based on a boolean value in the row. So I made a datatrigger. Here's my code:

     

    <Style TargetType="{x:Type xcdg:DataRow}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=HasAllocatedAsset}"
                                   Value="True">
                        <Setter Property="IsEnabled">
                            <Setter.Value>
                                False
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
     

    I'm setting the Row to be IsEnabled = False, when an "HasAllocatedAsset" is True.

     

    For your application, there should be a way to target your Setter (TargetName) at a certain object. If you manage to solve your problem, do show me your solution.

     

    Good Luck. 

    Filed under: ,
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.