I used dattriggers in the XamDataGrid for WPF but could not use
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
in the XamGrid. Are there any plans to allow datatriggers in the XamGrid? I wanted to allow or disallow editing of cells based a condition of the data and had to use the ActiveCellChanging and CellEnteringEditMode events to prevent editing of a cell based on a data condition. By the way, setting e.cancel = true in the ActiveCellChanging event did not prevent the cell from Activating, I also had to trap in the CellEnteringEditMode event.
Hello drdonna,
Thank you for getting back to me. If you have any further questions or concerns on this matter, please do not hesitate to ask.
Thanks for the ideas maybe the combination of the two will give me what I want. I will give it a try and let you know. At one point I had the AllowEdit scope at Row and changed it to Cell and maybe that change is the problem.
I was looking into your requirements and I believe that the functionality you are describing can be achieved by implementing IDataErrorInfo on your business objects in order to set a validation rule as it is shown in the following link form our sample browser:
http://samples.infragistics.com/sllob/RunSamples.aspx?cn=grid#/grid/idataerrorinfo
In addition you can set AllowEditng=”Row”, so the focus can stay on the row and move into its cells even when some of them have an error:
http://samples.infragistics.com/sllob/RunSamples.aspx?cn=grid#/grid/editing-data
If you require any additional assistance on this, please feel free to ask.
I have something kind of related. On a grid row if a user clicks "Accept" for a time transfer they are required to choose a reason code from a drop down combo box in the next cell to the Accept checkbox cell. I don't want the user to be able to remove focus from the grid row until they also pick a reason code from the combo editor. I have not been able to force the grid to stay on the row. I see editing examples for a single field being a specific value but what about other required fields on the same grid row?
I get around this by using a Childwindow but would rather force the user to stay on a grid row until all required data has been entered. Even though it is not an error until they try and move off the row without picking a value, I could set an error state on the row after "Accept" has been clicked even though they have not had a chance to pick a value yet? Maybe this would keep the focus on the row until the value was chosen?
I have used the SelectedRowsCollectionChanged event and messed with the PeviouslySelectedItems and NewSelectedItems but cannot keep focus on the grid row that is not complete. It puts the grid into a funky state where moving the cursor selects cells and rows that are hovered over by the cursor. I may be able to create a sample when I have some time. I am supposed to be doing testing this week and since I have a work around we will see if this is acceptable to the users.
I am really glad that you managed to resolve your issue. If you need any further assistance on the matter, please do not hesitate to ask.