Telerik Forums
UI for WinForms Forum
3 answers
175 views
Hi!

I'm encountering a Null reference when using RadGridView. The context in which it occurs is rather complex, and recreating the issue in a small, contained project will prove to be a lot of work. Before I head this way to get further support, I would like to post a stack trace in the hopes that someone will recognize this type of error and tell me of a solution.

I realize that this isn't a lot of information to help debugging. I'm just hoping for a quickfix before I get my hands dirty,

Here is the part of the stack trace that matters:

  Telerik.WinControls.GridView.dll!Telerik.WinControls.UI.GridTableElement.ViewTemplate.get() + 0x6 bytes 
  Telerik.WinControls.GridView.dll!Telerik.WinControls.UI.GridTableElement.InvalidateColumnWidths(Telerik.WinControls.UI.GridViewColumn column = null, int oldWidth = 0) + 0xc bytes 
  Telerik.WinControls.GridView.dll!Telerik.WinControls.UI.GridViewTemplate.UpdateColumns(Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e = {Telerik.WinControls.Data.NotifyCollectionChangedEventArgs}) + 0x22e bytes 
  Telerik.WinControls.GridView.dll!Telerik.WinControls.UI.GridViewColumnCollection.NotifyListenersCollectionChanged(Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e = {Telerik.WinControls.Data.NotifyCollectionChangedEventArgs}) + 0x55 bytes 
  Telerik.WinControls.dll!Telerik.WinControls.Data.ObservableCollection<System.__Canon>.OnCollectionChanged(Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e) + 0x29 bytes 
  Telerik.WinControls.dll!Telerik.WinControls.Data.ObservableCollection<System.__Canon>.EndUpdate(bool notifyUpdates) + 0x62 bytes 
  Telerik.WinControls.dll!Telerik.WinControls.Data.ObservableCollection<System.__Canon>.EndUpdate() + 0x10 bytes 
  Telerik.WinControls.GridView.dll!Telerik.WinControls.Data.DataAccessComponent.AutoGenerateGridColumns() + 0x301 bytes 
  Telerik.WinControls.GridView.dll!Telerik.WinControls.Data.DataAccessComponent.currencyManager_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e) + 0xb4 bytes 
  System.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.OnListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x17 bytes 
  System.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.List_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e) + 0x51c bytes 
  System.Windows.Forms.dll!System.Windows.Forms.BindingSource.OnListChanged(System.ComponentModel.ListChangedEventArgs e) + 0x7e bytes 
  System.Windows.Forms.dll!System.Windows.Forms.BindingSource.ResetBindings(bool metadataChanged) + 0x35 bytes 
  System.Windows.Forms.dll!System.Windows.Forms.BindingSource.SetList(System.Collections.IList list, bool metaDataChanged, bool applySortAndFilter = true) + 0xf0 bytes 
  System.Windows.Forms.dll!System.Windows.Forms.BindingSource.ResetList() + 0xd1 bytes 
  System.Windows.Forms.dll!System.Windows.Forms.BindingSource.DataSource.set(object value) + 0x34 bytes 

Below this is my user code. The line that throws the exception assigns a generic list of objects to the DataSource of my BindingSource. The RadGridView uses a master-child GridViewTemplate. The error occurs when I try to assign the DataSource of the child.

Thank you.
Jack
Telerik team
 answered on 15 Sep 2009
1 answer
208 views
Hi the Telerik Team,

If I have a column name which contains a dot (e.g. Suppliers.Title), no data is displayed for this column in the RadGridView.

For your information:
  • I use the version 2009.9.729
  • I bind a DataTable to the RadGridView
  • My DataTable is created from an SQL Query (which explains the Suppliers.Title)
  • I have ensured that the column contains data
  • If I rename my column to "Suppliers_Title", it returns the data (e.g. in my sql query : SELECT Suppliers.Title AS Suppliers_Title, ...)
  • If I execute this statement ((DataRowView)((BindingSource)resultsRadGridView.DataSource)[0])["Suppliers.Title"], the data is returned too

Thank you for your help,

Regards,
Julian Benkov
Telerik team
 answered on 15 Sep 2009
14 answers
563 views
hi
i set a data source (data table ) to the grid with the line

DataGrid.DataSource = dt;

then i save some staff in my DB and then i wanted to bound  different data table to the same grid using the same command line
DataGrid.DataSource = saveddt;

but i get a null reference exception

Object reference not set to an instance of an object.

  at Telerik.WinControls.UI.GridTableBodyElement.editor_Validated(Object sender, EventArgs e)\r\n   at Telerik.WinControls.UI.RadCheckBoxEditor.OnValidated(EventArgs args)\r\n   at Telerik.WinControls.UI.RadCheckBoxEditor.SaveValue()\r\n   at Telerik.WinControls.UI.GridTableBodyElement.ResetActiveEditor(Boolean restoreOriginalValue)\r\n   at Telerik.WinControls.UI.GridTableBodyElement.Update(Boolean dataSourceChanged)\r\n   at Telerik.WinControls.UI.GridTableElement.Update(Boolean dataSourceChanged)\r\n   at Telerik.WinControls.UI.GridViewInfo.UpdateView(Boolean dataSourceChanged)\r\n   at Telerik.WinControls.UI.GridViewInfo.UpdateView()\r\n   at Telerik.WinControls.UI.GridViewTemplate.Rebind()\r\n   at Telerik.WinControls.UI.RadGridView.RefreshColumnsAndRows()\r\n   at Telerik.WinControls.UI.GridViewData.InitDataOnly()\r\n   at Telerik.WinControls.UI.GridViewData.InitView()\r\n   at Telerik.WinControls.UI.GridViewData.SetDataConnection(Object dataSource, String dataMember)\r\n   at Telerik.WinControls.UI.RadGridView.DoDataBinding()\r\n   at Telerik.WinControls.UI.RadGridView.CallDoDataBinding()\r\n   at Telerik.WinControls.UI.GridViewTemplate.set_DataSource(Object value)\r\n   at Telerik.WinControls.UI.RadGridView.set_DataSource(Object value)\r\n  

Jack
Telerik team
 answered on 15 Sep 2009
3 answers
198 views
Hi,

I am facing a problem with Rad Carousel. Please help me.
Rad carousel animations are not applicable.
 If i add 5 RadButtonItems i can see only three of them on the Carousel path.

I have reinstalled the Telerik trail version, even  i am facing the same.
Previously it was working fine...

Please can you help me.

thanks,
Madala Mahitha.
Peter
Telerik team
 answered on 15 Sep 2009
2 answers
259 views
I remember seeing that a RadButton no longer fires a double-click event and instead fires two Click events.

I have code that used to run in the double-click event handler for a RibbonTab, but now that code no longer runs with version 2009.2.9.729.  Does the RibbonTab also no longer fire a double-click event?  If not, do you have any suggestions for simulating a double-click, as I have separate code for the (single) click event handler.

Thanks,
Nicholas Wasko
Nick Wasko
Top achievements
Rank 1
 answered on 14 Sep 2009
3 answers
154 views
I find that if I have EmptyValue.Mode set to Approximation, I get undesired results in my graph if I have multiple values missing in a row. For example, if I have these consecutive values in my series:

1, 2, <empty>, <empty>, <empty>, 3, 4, 5

The dotted line looks like it is using:

1, 2, 2.5, 2.5, 2.5, 3, 4, 5

In this series, I would expect the approximation to result in, or even just 1, 2, 3, 4, 5:

1, 2, 2.25, 2.50, 2.75, 3, 4, 5

I would actually like to ignore those three data points entirely.. Consider this data:

0.05     1     5
0.10     2
0.15
0.20            6
0.25            7
0.30     3
0.35     4
0.40     5     9

I essentially want the empty fields to be ignored for each ChartSeries, or approximated better than I described above (2.5 for all three missing values in the second column). Is there a mode I can set in the approximation that I'm missing, or is what I'm getting the only possible behavior? The only two EmptyValue modes I see are "Zero" and "Approximation", neither of which do what I want.

Thanks,
Baris
Ves
Telerik team
 answered on 14 Sep 2009
1 answer
139 views
I have a form (parent) that instantiates a DocumentWindow object which adds a child form (documentWindow.Controls.Add(childForm)) and sets the autoscroll property to true (documentWindow.AutoScroll = True).  I am trying to figure out how to bring focus to this control. 

How can I set focus to a DocumentWindow's scrollbar through code?

Thanks,
Deyan
Telerik team
 answered on 14 Sep 2009
1 answer
94 views
When I add new row in to Grid and binding data again and see this error
System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="Telerik.WinControls.GridView"
  StackTrace:
       at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDownLeft(MouseEventArgs e)
       at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDown(MouseEventArgs e)
       at Telerik.WinControls.UI.RadGridView.OnMouseDown(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at Telerik.WinControls.RadControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at BizCompany.Program.Main() in C:\Documents and Settings\DANG\My Documents\Visual Studio 2005\Projects\BizCompany.root\BizCompany\Program.cs:line 17
Jack
Telerik team
 answered on 14 Sep 2009
12 answers
334 views
Hi,

I was wondering if there is an article or section that contains documentation to create your own GridViewDataColumns as well as IInputEditors.  I've tried searching the forums and the library's documentation but certain classes/interfaces don't even have a complete reference texts.



Jack
Telerik team
 answered on 14 Sep 2009
9 answers
237 views
Tag
For each row I add in the GirdView, I set a tag like this

GridViewDataRowInfo row = aGridView.Rows.AddNew();
row.Tag = 1;

RadGridView.Rows.Add(row);

and when I click on a row in the Girdview, I want to get the associated tag to the selectedrow.

The problem is that RadGridView.SelectedRows[0].tag is always null.

I found out that RadGridView.SelectedRows[0] return a GridViewRowInfo and not a GridViewDataRowInfo.

Is there a quick way to have the tag of the GridViewDataRowInfo object of the selectedrow ?

 



Nick
Telerik team
 answered on 14 Sep 2009
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?