Home Forums WPF controls Xceed DataGrid for WPF enabling the Combobox with respect to checkbox

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

    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.

    Imported from legacy forums. Posted by asdf (had 585 views)

    User (Old forums)
    Member
    Post count: 23064

    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. 

    Imported from legacy forums. Posted by Eric (had 1679 views)

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