views:

3193

answers:

2

I have put an UltraGrid on a WinForms user control. I have tweaked some settings so I can use the grid as a read-only multi-row select table. But there's one problem: by default the first row appears to be selected.

But the Selected.Rows property is empty, and also the ActiveRow property is null.

So the row appears to be selected, but it actually isn't, making it impossible to remove the selection.

I'm sure there must be a setting hidden somewhere on the UltraGrid to control this behavior. And if this is not the case then maybe there's a workaround?

Thanks.

+3  A: 

After some more research I have found a solution, which I'll share with all of you:

myUltraGrid.DisplayLayout.Override.ActiveCellAppearance.Reset();
myUltraGrid.DisplayLayout.Override.ActiveRowAppearance.Reset();
Gerrie Schenck
+1  A: 

I have exactely the same problem you had, but Gerrie Schenck's solution don't work for me. I used this trick: MyUltraGrid.ActiveRow = MyUltraGrid.Rows[0]; MyUltraGrid.ActiveRow = null;