Hi, I have a grid with a bunch of data in template columns. When I select a row, details for the row are populated in a reading pane which is not part of the grid in any way. I have a button in that pane which then applies an action to the selected event, part of that is validating the data which the user has filled out. If there is data missing then background color on the empty fields in the gridviewrow is changed. This works great except when the grid is grouped because I can't seem to get the selected row.
I usually do this:
But if any grouping has been done then this returns null. I have also tried to retrieve the active or selected row based on the reading pane (not really a pane but a grid called GridControls):
I usually do this:
activerow = (
GridViewRow)rgvEvents.ItemContainerGenerator.ContainerFromItem(rgvEvents.SelectedItem);
But if any grouping has been done then this returns null. I have also tried to retrieve the active or selected row based on the reading pane (not really a pane but a grid called GridControls):
activerow = (
GridViewRow)rgvEvents.ItemContainerGenerator.ContainerFromItem(GridControls.DataContext);
Either way active row is NULL (only when there is grouping). Based on some of the other threads I have just read, you guys are pretty aware of this behavior and have recommended work arounds that don't require accessing the controls in the gridviewrow directly. I'm open to that but the only thing I can think of is using a converter to set the background color of the controls in the grid dynamically but that is going to create a lot of work for me. Do you have any better ideas?