Welcome to the Xceed Community | Help
Community Search  
More Search Options

Xceed Cell/Column Behaviour

Sort Posts: Previous Next
  •  10-10-2009, 1:32 AM Post no. 24406

    Xceed Cell/Column Behaviour

    Hello,

        Xceed Team,


    I am using the Xceed Grid for the inline Editing.  
    Now we are having the requirement , while editing the row ,
    •    Some cells in the row are read only,
    •    Some cells are required fields
    •    Some cells are non- required

    Now, we are able to achieve the validation and also specifying the read only in the Column level.
    But, we want to distinguish  the cell based on the 3 types of cell as specified above using different color at cell level.


    For exa:   EID is read only cell/column , then I want Light Orange Color for that particular cell.
           Address is non-required fields, then I want White Color for that particular cell.
             EName is required fields, then I want Yellow Color for that particular cell.    

    I have to implement the above requirement, in the Xceed Grid whenever the Row is in Edit Mode.

    Kindly tell us how to achieve the same.


    Thanks,

    Paras Sanghani


    Nothing Is Impossible
  •  10-16-2009, 12:32 PM Post no. 24561 in reply to 24406

    Re: Xceed Cell/Column Behaviour

    Hi Paras,

     To visually distinguish a DataCell that is Readonly, you should create an implicit Style whose targettype is DataCell and a DataTrigger that checks whether the ReadOnly property is True, then use a setter to set the Background property to Orange as follow:

    <Style TargetType="xcdg:DataCell">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=ReadOnly,RelativeSource={RelativeSource Self}}"
                                    Value="True">
                            <Setter Property="Background"
                                    Value="Orange"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>

    Please do the same for other conditions you have.

    Xceed - Software Developer and Technical Support
  •  05-25-2010, 10:42 AM Post no. 26961 in reply to 24561

    Re: Xceed Cell/Column Behaviour

    I just tried this but doesn't work.

    my code is as below

    <DataGrid:DataGridControl.Resources>

    <Style x:Key="{x:Type DataGrid:DataCell}" TargetType="DataGrid:DataCell">

    <Style.Triggers>

    <DataTrigger Binding="{Binding Path=ReadOnly,RelativeSource={RelativeSource Self}}"

    Value="True">

    <Setter Property="Background"

    Value="Red"/>

    </DataTrigger>

    </Style.Triggers>

    </Style>

    <BooleanToVisibilityConverter x:Key="BoolToVisConverter" />

    </DataGrid:DataGridControl.Resources>

    <DataGrid:DataGridControl.Columns>

    <DataGrid:Column FieldName="Name" Title="Name" ReadOnly="True" />

    </DataGrid:DataGridControl.Columns>

  •  05-26-2010, 2:08 AM Post no. 26969 in reply to 26961

    Re: Xceed Cell/Column Behaviour

    Your code is very slightly different to the previous answer. You are specifying an x:Key in the Style which means it will only be applied to DataGrid:DataCell objects that specify the x:Key.

    It is like giving the Style a name, and only using it by that name. Can you try your code by removing the x:Key property as this should then work.

  •  05-26-2010, 3:43 PM Post no. 26981 in reply to 26969

    Re: Xceed Cell/Column Behaviour

    Hi Zain,

    I tested with Derek's suggestion of removing the x:Key, but the problem was still there.

    After further testing I found that the following change to the Path fixed the issue:

       <Style TargetType="{x:Type xcdg:DataCell}">
          <Style.Triggers>
             <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=ParentColumn.ReadOnly}"
                                 Value="True">
                <Setter Property="Background" Value="Red"/>
             </DataTrigger>
          </Style.Triggers>
       </Style>

    Reference: http://xceed.com/CS/forums/thread/10897.aspx

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.