Home - Forums-.NET - FlyGrid.Net (Windows Forms) - FlyGrid, Selecting and Focus

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

FlyGrid, Selecting and Focus
Link Posted: 03-May-2007 21:15
Hi there...

First post, hope you can help me

I use the FlyGrid to display some kind of news data in multiple windows at the same time. Every time my newslist in the FlyGrid is updated, i insert x news at the top. I want to keep the currently selected Item anyway, so i store the index of the selected item within the list before the update is done and then reassign the FlyGrid.Selected property with the item at the correct position (oldposition + offset)

No problem so far. But now, every time i reassign the selected item, the control gets the focus. In the stacktrace, i see the calls are like this:

-> Assign the Item with FlyGrid.Selected
-> internal call to FlyGrid.set_Selected
-> internal call  to FlyGrid.SetFocusToNode
-> internal call to some sort of hidden method
-> internal call to Windows.Forms.Control.Focus

Of course, i dont want to jump my focus around from window to window. Is there a way to supress the focus call or a alternative way to keep the selected Item while changing the list of items?

thanks
Kuddel
Link Posted: 04-May-2007 05:05
Please let me know what version of FlyGrid you use, as we've solved this problem in the latest updates.
Link Posted: 07-May-2007 05:27
Currently, i am using version 1.4.0.8.

Did not look for a update yet, i have to admit. So, a update should fix this problem? Current workaround (very dirty!!!) is a codeblock like this:

FlyGrid.BeginInit();
ControlContainingFlyGrid.Enabled = false;
FlyGrid.Selected = ItemToSelect;
ControlContainingFlyGrid.Enabled = true;
FlyGrid.EndInit();