Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Using enter key on hierachy columns result in error!

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

Using enter key on hierachy columns result in error!
Link Posted: 14-Sep-2007 02:40
I have a flygrid with one hierarchy column and other \"usual\" columns.
When i want to use the enter to trigger an action i get a error:

Index out of bounds!

Stacktrace:

bei .8.get_Item(Int32 index)
   bei NineRays.Windows.Forms.Data.VirtualNode.()
   bei NineRays.Windows.Forms.Data.NodeBase.GetFirst()
   bei NineRays.Windows.Forms.Data.NodeBase.GetNext()
   bei NineRays.Windows.Forms.Grids.HierachyColumn.88(FlyGrid , NodeBase , Char )
   bei NineRays.Windows.Forms.Grids.HierachyColumn.OnKeyPress(FlyGrid grid, NodeBase node, KeyPressEventArgs ke)
   bei NineRays.Windows.Forms.FlyGrid.OnKeyPress(KeyPressEventArgs ke)
   bei System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   bei System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   bei System.Windows.Forms.Control.WmKeyChar(Message& m)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei NineRays.Windows.Forms.FlyGrid.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Any help is very much appreciated.

I also noticed that although i have an event handler for this event, the event handler is never invoked in combination with the hierachical column.

So is it a bug in the flygrid component itself?

Thank you.
Link Posted: 14-Sep-2007 05:18
Do you mean you're using the  Enter key and that causes the error above?
Link Posted: 14-Sep-2007 05:50
Can you please also send me a code from your event handler?

Also, why do you need the hierarchical column?
Link Posted: 16-Sep-2007 22:31
Hello,

yes I mean that i get the exception when i use the ENTER key.

Another problem is that the event (KeyUp) is never invoked.

So here is the code:

// If the pressed key was the enter key
            if (e.KeyCode == Keys.Enter)
            {
                String number = \"\";
                // Get the selected nodes
                NodeBase[] selection = flyGrid.Rows.SelectedNodes;

                // Proceed only if one entry has been selected
                if (selection.Length == 1)
                {
                    // If not nodes has been selected
                    if (flyGrid.Selected != null)
                    {
                        // Fetch the data from the datatable
                        DataRow callRow = m_dtprovider.GetDataTable().Rows[flyGrid.Selected.Index];

                        if (m_config.PeriodViewAktiv)
                        {
                            number = this.GetNumberForRow();
                        }
                        else
                        {
                            // Get the number
                            number = (String)callRow[DataTableProvider.InternalColumnNames.InternationalId.ToString()];
                        }

                        if (number != null && !number.Equals(\"\"))
                        {
                            // Call the number  
                            this.InitConnection(number);
                        }
                    }
                }
            }


Why i use the hierachical column? The reasons is that i need a hierachical view. What would you suggest?

Regards,

Sebastian
Link Posted: 17-Sep-2007 09:21
Sebastian,

I created a test case similar to your configuration. And got everything behaving as it should.

What if you comment out your key press handler. Do you still get the error?
Link Posted: 18-Sep-2007 02:12
Hello,

yes i do still get the error when i comment the handler out.

Any suggestions?

Sebastian
Link Posted: 18-Sep-2007 03:41
Sebastian,

The best and 100% way to find and fix a bug is a simple demo application that we can run locally and fix the issue.

Please, copy the flygrid with all its setting into a simple windows forms application with the only testing form. Then zip your project and send to support*9rays.net
Link Posted: 18-Sep-2007 23:30
Hi,

i tried  to send you the demo project but your mail filter seem to reject it because of the attachment.

I made a simple demo app but without the exact settings of my current project. I added one hierachical column and some usual text columns.

When i then started the project and pressed the ENTER key i got a null pointer exception.

I have no idea where this comes from.

Nevertheless...i need a solution for this problem!

Regards,

Sebastian
Link Posted: 19-Sep-2007 06:09
Yes, I'm doing exactly the same, but here it's OK.

Could you please upload your project to

ftp://download.9rays.net/9r_incoming/

Thanks in advance.
Link Posted: 20-Sep-2007 23:55
Hello,

i uploaded the simple application.

Hope you can help me!

Regards,

Sebastian