I am using XamDataGrid in my application and i want to Enable/Disable (Gray out) row in XamDatagrid depending upon perticular column Data.
As Example i have list of user that i want to show in XamDataGrid. If User's Login is expired row will show disable(gray out) and no data should allow to be changed. if its active login normal row will be displayed in grid.
Hello Nikhil,
If you want to keep the Cell selection yo ucan use the same DataTrigger in Styles for the Editors that present the values. Please note that you will have to create Styles for all Editors that will be used in your XamDataGrid (e.g. XamTextEditor, XAmNuemricEditor, XamDateTimeEditor and etc.).
Hope this helps you.
Thanks for help! this solve my first problem as I am able to select the rows.
But problem is I can't select the cell of these rows individially. I have come functionality on cell selection too (from both enabled and disabled row with ctrl click) that is not working.
any suggetion/help?
You can use the same Trigger in a Style for the CellValuePresenter, this way the Record will be selectable:
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <Style.Triggers> <DataTrigger Binding="{Binding DataItem.Age}" Value="18"> <Setter Property="IsEnabled" Value="False"/> </DataTrigger> </Style.Triggers> </Style>
if I do IsEnabled = false, it's not letting me select this row either. I what to have allow row to selectable and but it should not be editable. What is best way to achive this functionality?
Atman,
We are always glad to help.
If you stumble on any other problems feel free to address them to us in the forum.
Alex.