Home - Forums-.NET - FlyGrid.Net (Windows Forms) - OnRowChangedOrLostFocus

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

OnRowChangedOrLostFocus
Link Posted: 02-Oct-2007 15:51
In the help file it states that OnRowChangedOrLostFocus fires UpdateRowData event if user current row is modified and when user moves focus to another row or FlyGrid lost focus,

However I find that the UpdateRowData event is fired after every cell edit not when the user leaves the row. This is a problem as the data is sorted after the user enters a vaue in the first new row cell. This causes it to move position in the grid and the user has to then go hunting for it to fill in the rest of the data.
Link Posted: 02-Oct-2007 21:23
Thanks,
This should be definitely fixed.
Link Posted: 07-Oct-2007 22:21
We have the same problem. When I do

BeginInit
foreach
  node[colid] = newvalue // update one column on Timer event
EndInit

grid re-sorts rows every time in opposite direction

from user experience it looks like rows moving often forth and back. they get really frustrated as couldnt understand what is going on...

I did forced sort by dateTime column to ensure the grid is sorted in same way all the time but this bug is really annoying and forced sort is not a solution anyway.

please announce here in the forum when you will fix it.

thanks
Link Posted: 08-Oct-2007 00:08
ок, I'll post here as soon as we have fixed release.
Link Posted: 08-Oct-2007 05:35
Here is the code to replicate. Have a form with a flyGrid and a button.

Run it, then sort column B (by clicking on the header) where all strings are equal and then press button few times (which updates grid).

Look at column A - rows being re-sorted in some weird cycle... I afraid that it is another problem inherited from your 'ADO.NET thingy'... Not sure you can fix it.

        public Form2()
        {
            InitializeComponent();

            Column a = new Column(\"colA\", \"colA\");
            Column b = new Column(\"colB\", \"colB\");
            Column c = new Column(\"colC\", \"colC\");

            flyGrid1.Columns.Items.Add(a);
            flyGrid1.Columns.Items.Add(b);
            flyGrid1.Columns.Items.Add(c);

            for (int i = 0; i < 5; i++)
            {
                flyGrid1.Rows.Items.Insert(0, new Node(new object[] {i, \"Const\", \"Var\"}));
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            flyGrid1.BeginInit();

            foreach (Node n in flyGrid1.Rows.Items)
            {
                n[2] = \"Var\";
            }

            flyGrid1.EndInit();
        }
Link Posted: 09-Oct-2007 12:24
Thanks for the code.
Link Posted: 22-Oct-2007 16:09
shager,

Yes, you were almost right when said about problem inheritance.
The core reason arrives from .NET sorting implementation.

.NET uses unstable sorting. So when FlyGrid sorts its nodes with equal values, it can (and actually does) swap equal nodes.

So we implemented stable sorting algorithm for FlyGrid sorting needs.

It also decreases general sorting speed of FlyGrid. We're going to tweak it with next releases.

The new version is already available at our downloads section. Thanks.