Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Issue with datagrid Silverlight Beta 2
2 replies. Latest Post by Raguvind on July 18, 2008.
(0)
Raguvind
Member
6 points
15 Posts
07-14-2008 3:11 AM |
Hi All
I am using Datagrid control to load data. The data is not binded directly. For example in the row load event I am using the Column.GetContent method to get the control inside the cell and setting the content to it. The issue I am facing is that when ever my mouse moves over the header the following exception occurs.
Exception Message:
Value does not fall within the expected range.
Stack trace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.SetValue(IntPtr oPtr, UInt32 iPropertyId, DependencyObject doh)
at MS.Internal.XcpImports.SetValue(IntPtr oPtr, UInt32 iPropertyId, Object obj)
at System.Windows.DependencyObject.SetObjectValueToCore(IntPtr oPtr, DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean isSetByStyle, Boolean isSetByBuiltInStyle)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Controls.ContentControl.set_Content(Object value)
at System.Windows.Controls.DataGridColumn.CreateHeader()
at System.Windows.Controls.DataGridColumnHeader.OnMouseMove_Reorder(Boolean& handled, Point mousePosition, Point mousePositionHeaders, Point mousePositionGrid, Point mousePositionGridParent, Double distanceFromLeft, Double distanceFromRight)
at System.Windows.Controls.DataGridColumnHeader.OnMouseMove(Boolean& handled, Point mousePosition, Point mousePositionGridParent)
at System.Windows.Controls.DataGridColumnHeader.DataGridColumnHeader_MouseMove(Object sender, MouseEventArgs e)
at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
I am not sure whether it is some problem with the data grid or something with the way I am using the data grid need help on this.
lee_sl
Contributor
2992 points
585 Posts
07-14-2008 8:17 AM |
I think this is a bug, which was discussed a couple of weeks back. cannot find the actual post
07-18-2008 12:49 AM |
Hi,
The issue comes when i add an Textblock or any other control in the header. I have solved the issue by setting the "CanUserReorderColumns" property to false.