We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ExpandAtRowIndex throws exception.

Thread ID:





37495 Nov 23,2005 12:26 PM UTC Nov 24,2005 07:28 AM UTC WinForms 2
Tags: GridControl
Asked On November 23, 2005 12:26 PM UTC

Hi! I''m using an hierarchy GDBG and I would like the first node to be expanded by default. When I try to call the ExpandAtRowIndex() with the correct rowindex I get an exception thrown from the grid saying: "Object reference not set to an instance of an object." Stacktrace: at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.ExpandAtRowIndex(Int32 rowIndex) at Presentation.Forms.PrognosisOrganizationTree.PrognosisOrganizationTree_Load(Object sender, EventArgs e) in c:\\forms.presentation\\forms\\prognosisorganizationtree.cs:line 372 at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) The code is placed in the Form_Load event, could that be to early for the grid to expand the node? I have tried to call ExpandAll() instead at the same place which works just fine. Any ideas?

Administrator [Syncfusion]
Replied On November 23, 2005 12:37 PM UTC

At the bottom of form.Load are you using code like this? this.gridDataBoundGrid1.ExpandAtRowIndex(this.gridDataBoundGrid1.Model.Rows.HeaderCount + 1); You have to make sure you pass in the right rowindex as each hierarchylevel has its own column header row. The above code worked for me using version 3.3.

Replied On November 24, 2005 07:28 AM UTC

Ahh that made it work! Thanks Clay!


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon