When a cell is selected, I would like to programatically (in C#) check if it has been assigned an overridden style named "MyLocalStyle"
I'm trying to accomplish this in the SelectedItemsChanged Event
<dataPresenter:Field Name="total_flows" > <dataPresenter:Field.Settings> <dataPresenter:FieldSettings CellValuePresenterStyle="{StaticResource MyLocalSyle}"/> </dataPresenter:Field.Settings> </dataPresenter:Field>
Hello,
In case it comes down to single cell, I can suggest using CellActivated Event, as SelectedItemsChanged will return a collection and you will have to iterate trough it.
In order to retrieve the cell, you can use the CellValuePresenter's method FromCell, and check if it matches to your custom one:
private void xamDataGrid1_CellActivated(object sender, Infragistics.Windows.DataPresenter.Events.CellActivatedEventArgs e) { var isStyleApplied = CellValuePresenter.FromCell(e.Cell).Style == MyLocalStyle; }
Should you have any further questions, please let me know.
Sincerely,Tihomir TonevAssociate Software DeveloperInfragistics