Hi
When our main application loads, the user has to option to display 0-5 grids which are just flat grids of data they want to see at the beginning of the day.
By default, I don't want there to be any activerow in any of the grids. Setting SyncWithCurrencyManager=false works except for the first grid in the layout.
I assume it might be something to do with that grid being the first focused control in the form?
At the moment to work around it, I've put the following in the AfterRowActivate event:
static firstCall as boolean = true
If firstCall then firstCall = false grid.ActiveRow = nothing Exit Sub End If ....
It seems a bit of an ugly workaround though. Is there a better way or am I misunderstanding how it works?
Thanks
Hi,
I'm not sure that the grid automatically sets an ActiveRow when it gets focused, but your theory seems reasonable. To confirm it, you could try setting the TabIndex on the grids so that some other grid or control is the first in the tab order and see if the new grid is the one that gets an active row.
You could also try putting a breakpoint in the BeforeRowActivate event of the grid and then look at the call stack to see what's triggering the activation of the row.
Just to clarify... are you trying to prevent the grid from ever having an active row? Or do you just not want the grid to have an active row initially?
You could turn off the ActiveRowAppearance so that the ActiveRow is not highlighted:
FAQ:How do I turn off the ActiveRowAppearance so that the active row in the grid does not appear selected.
And you could even remove the Focus rectangle if that helps.
HOWTO:How can I turn off the Focus Rectangle on an Infragistics Win Control?