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. Image for the cookie policy date

NULL REFERENCE

am facing a problem.I have syncfusion grid and first four columns are of type drop down. Now for the third column (Column Header- Team Type Shown in picture 1) I am binding the above mentioned cells of that column with the datatable as Follows teamTypegrCV.Item(currentCellRowIndex, 3).DataSource = tempTableCopy(''This is a Datatable) teamTypegrCV.Item(currentCellRowIndex, 3).DisplayMember = "TeamName" teamTypegrCV.Item(currentCellRowIndex, 3).ValueMember = "TeamID" And on selection of Item from the third column I am filling the cells of column 4 after some filtration.using the code as follows. teamTypegrCV.Item(currentCellRowIndex, 4).DataSource = filteredDataTable(''This is a Datatable) teamTypegrCV.Item(currentCellRowIndex, 4).DisplayMember = "TeamName" teamTypegrCV.Item(currentCellRowIndex, 4).ValueMember = "TeamID" Even the Grid column 4 gets the filtered records but as soon as I select the record(See Picture -2) I get the Error Shown in picture - 3(Which says Syncfusion.NullRefrenceException occurred in sysncfusion.grid.windows.dll) The problem is I am not able to catch the exception. Any Inputs Regards Lokesh Picture_8328.zip

5 Replies

LL Lokesh Luthra February 1, 2005 03:52 AM UTC

to add more when I run the EXE I get this message See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Windows.Forms.Grid.GridComboBoxCellModel.GetItemValue(Object dataSource, String valueMember, Object item) at Syncfusion.Windows.Forms.Grid.GridComboBoxCellRenderer.SynchronizeDisplayText(Int32 index) at Syncfusion.Windows.Forms.Grid.GridComboBoxCellRenderer.ListBoxMouseUp(Object sender, MouseEventArgs e) at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e) at Syncfusion.Windows.Forms.Grid.GridComboBoxListBoxPart.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ListBox.WndProc(Message& m) at Syncfusion.Windows.Forms.Grid.GridComboBoxListBoxPart.WndProc(Message& msg) 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) ************** Loaded Assemblies ************** mscorlib Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll ---------------------------------------- Screens Assembly Version: 1.0.1858.40489 Win32 Version: 1.0.1858.40489 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/Screens.exe ---------------------------------------- OnTrack Assembly Version: 1.0.1.7 Win32 Version: 1.0.1.7 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/OnTrack.DLL ---------------------------------------- System.Windows.Forms Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll ---------------------------------------- System Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll ---------------------------------------- OnTrack.Interfaces Assembly Version: 1.0.0.1 Win32 Version: 1.0.0.1 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/OnTrack.Interfaces.DLL ---------------------------------------- System.Data Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll ---------------------------------------- OnTrack.Common Assembly Version: 1.0.0.1 Win32 Version: 1.0.0.1 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/OnTrack.Common.DLL ---------------------------------------- System.Drawing Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll ---------------------------------------- System.Xml Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll ---------------------------------------- Microsoft.VisualBasic Assembly Version: 7.0.5000.0 Win32 Version: 7.10.3052.4 CodeBase: file:///c:/winnt/assembly/gac/microsoft.visualbasic/7.0.5000.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll ---------------------------------------- OnTrack.Remoting Assembly Version: 1.0.1858.39123 Win32 Version: 1.0.1858.39123 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/OnTrack.Remoting.DLL ---------------------------------------- System.EnterpriseServices Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/assembly/gac/system.enterpriseservices/1.0.5000.0__b03f5f7f11d50a3a/system.enterpriseservices.dll ---------------------------------------- BusinessLayer Assembly Version: 1.0.1858.40489 Win32 Version: 1.0.1858.40489 CodeBase: file:///c:/mercer/ontrack/businesslayer/bin/businesslayer.dll ---------------------------------------- Modularis.Control Assembly Version: 5.11.0.3505 Win32 Version: 5.11.0.3505 CodeBase: file:///c:/winnt/assembly/gac/modularis.control/5.11.0.3505__7db19fbd325ab1f5/modularis.control.dll ---------------------------------------- Ontrack.EntityDDC Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/Ontrack.EntityDDC.DLL ---------------------------------------- Modularis.StateManagement Assembly Version: 5.11.0.3505 Win32 Version: 5.11.0.3505 CodeBase: file:///c:/winnt/assembly/gac/modularis.statemanagement/5.11.0.3505__7db19fbd325ab1f5/modularis.statemanagement.dll ---------------------------------------- Modularis Assembly Version: 5.11.0.3505 Win32 Version: 5.11.0.3505 CodeBase: file:///c:/winnt/assembly/gac/modularis/5.11.0.3505__7db19fbd325ab1f5/modularis.dll ---------------------------------------- Syncfusion.Grid.Windows Assembly Version: 3.0.1.0 Win32 Version: 3.0.1.0 CodeBase: file:///c:/winnt/assembly/gac/syncfusion.grid.windows/3.0.1.0__3d67ed1f87d44c89/syncfusion.grid.windows.dll ---------------------------------------- Syncfusion.Shared.Base Assembly Version: 3.0.1.0 Win32 Version: 3.0.1.0 CodeBase: file:///c:/winnt/assembly/gac/syncfusion.shared.base/3.0.1.0__3d67ed1f87d44c89/syncfusion.shared.base.dll ---------------------------------------- Syncfusion.Core Assembly Version: 3.0.1.0 Win32 Version: 3.0.1.0 CodeBase: file:///c:/winnt/assembly/gac/syncfusion.core/3.0.1.0__632609b4d040f6b4/syncfusion.core.dll ---------------------------------------- Syncfusion.Grid.Base Assembly Version: 3.0.1.0 Win32 Version: 3.0.1.0 CodeBase: file:///c:/winnt/assembly/gac/syncfusion.grid.base/3.0.1.0__3d67ed1f87d44c89/syncfusion.grid.base.dll ---------------------------------------- Syncfusion.Shared.Windows Assembly Version: 3.0.1.0 Win32 Version: 3.0.1.0 CodeBase: file:///c:/winnt/assembly/gac/syncfusion.shared.windows/3.0.1.0__3d67ed1f87d44c89/syncfusion.shared.windows.dll ---------------------------------------- Ontrack.ActivityCore Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/Ontrack.ActivityCore.DLL ---------------------------------------- Ontrack.EntityCore Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/Ontrack.EntityCore.DLL ---------------------------------------- Ontrack.ActivityEE Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/Ontrack.ActivityEE.DLL ---------------------------------------- Ontrack.EntityEE Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/MERCER/OnTrack/Screens/bin/Ontrack.EntityEE.DLL ---------------------------------------- Modularis.Collections Assembly Version: 5.11.0.3505 Win32 Version: 5.11.0.3505 CodeBase: file:///c:/winnt/assembly/gac/modularis.collections/5.11.0.3505__7db19fbd325ab1f5/modularis.collections.dll ---------------------------------------- Accessibility Assembly Version: 1.0.5000.0 Win32 Version: 1.1.4322.573 CodeBase: file:///c:/winnt/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll ---------------------------------------- ************** JIT Debugging ************** To enable just in time (JIT) debugging, the config file for this application or machine (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the machine rather than being handled by this dialog. > am facing a problem.I have syncfusion grid and first four >columns are of type drop down. Now for the third column (Column Header- Team Type Shown in picture 1) I am binding the above mentioned cells of that column with the datatable as Follows > >teamTypegrCV.Item(currentCellRowIndex, 3).DataSource = tempTableCopy(''This is a Datatable) >teamTypegrCV.Item(currentCellRowIndex, 3).DisplayMember = "TeamName" >teamTypegrCV.Item(currentCellRowIndex, 3).ValueMember = "TeamID" > >And on selection of Item from the third column I am filling the cells of column 4 after some filtration.using the code as follows. >teamTypegrCV.Item(currentCellRowIndex, 4).DataSource = filteredDataTable(''This is a Datatable) >teamTypegrCV.Item(currentCellRowIndex, 4).DisplayMember = "TeamName" >teamTypegrCV.Item(currentCellRowIndex, 4).ValueMember = "TeamID" > >Even the Grid column 4 gets the filtered records but as soon as I select the record(See Picture -2) I get the Error >Shown in picture - 3(Which says Syncfusion.NullRefrenceException occurred in sysncfusion.grid.windows.dll) > >The problem is I am not able to catch the exception. >Any Inputs > >Regards >Lokesh > > >Picture_8328.zip > >


LL Lokesh Luthra February 1, 2005 07:04 AM UTC

Could anybody please respond to this problem > am facing a problem.I have syncfusion grid and first four >columns are of type drop down. Now for the third column (Column Header- Team Type Shown in picture 1) I am binding the above mentioned cells of that column with the datatable as Follows > >teamTypegrCV.Item(currentCellRowIndex, 3).DataSource = tempTableCopy(''This is a Datatable) >teamTypegrCV.Item(currentCellRowIndex, 3).DisplayMember = "TeamName" >teamTypegrCV.Item(currentCellRowIndex, 3).ValueMember = "TeamID" > >And on selection of Item from the third column I am filling the cells of column 4 after some filtration.using the code as follows. >teamTypegrCV.Item(currentCellRowIndex, 4).DataSource = filteredDataTable(''This is a Datatable) >teamTypegrCV.Item(currentCellRowIndex, 4).DisplayMember = "TeamName" >teamTypegrCV.Item(currentCellRowIndex, 4).ValueMember = "TeamID" > >Even the Grid column 4 gets the filtered records but as soon as I select the record(See Picture -2) I get the Error >Shown in picture - 3(Which says Syncfusion.NullRefrenceException occurred in sysncfusion.grid.windows.dll) > >The problem is I am not able to catch the exception. >Any Inputs > >Regards >Lokesh > > >Picture_8328.zip > >


AD Administrator Syncfusion Team February 1, 2005 07:27 AM UTC

If you want a guaranteed response, you need to use our Direct Trac support system. This is a public forum, where the public may, or may not, respond to your posts. Syncfusion employees may also respond provided their schedule permits, but this forum is not our primary support venue, and it may be the case that some posts may go unresponded to. I assume teamTypegrCV is a GridControl. If it is a GridDataBoundGrid, then using indexers will not work to set style properties of individual cells. What I would suggest doing is to set some DataSource, Datamember, and DisplayMember properties on grid.ColStyles(4). The datasource should be such that it includes all possible values that will appear in the dropdown in any cell. Another opttion is not to explicitly set these properties as you are doing, but to provide them on demand in CurrentCellShowingDropDown as in this KB. http://www.syncfusion.com/Support/article.aspx?id=567


LL Lokesh Luthra February 1, 2005 09:49 AM UTC

Hello Clay I was not aware of this that this is a public forum.Any way your solution worked but I dont understand wat was the problem in my approach.Any way thanx for your timely tip. Regards Lokesh >If you want a guaranteed response, you need to use our Direct Trac support system. This is a public forum, where the public may, or may not, respond to your posts. Syncfusion employees may also respond provided their schedule permits, but this forum is not our primary support venue, and it may be the case that some posts may go unresponded to. > >I assume teamTypegrCV is a GridControl. If it is a GridDataBoundGrid, then using indexers will not work to set style properties of individual cells. > >What I would suggest doing is to set some DataSource, Datamember, and DisplayMember properties on grid.ColStyles(4). The datasource should be such that it includes all possible values that will appear in the dropdown in any cell. > >Another opttion is not to explicitly set these properties as you are doing, but to provide them on demand in CurrentCellShowingDropDown as in this KB. http://www.syncfusion.com/Support/article.aspx?id=567


AD Administrator Syncfusion Team February 1, 2005 10:03 AM UTC

The cell was probably being initialized with style setting where style.DataSource/DisplayMember/ValueMember was null, and you trying to dynamically set the style values to something else was not fully resetting the initial values. By setting up appropriate default values in the columnstyles, the cell is initialized with proper values even if you later switch out the DataSource.

Loader.
Up arrow icon