Skip to main content

Microsoft Silverlight

Answered Question Issue with datagrid Silverlight Beta 2RSS Feed

(0)

Raguvind
Raguvind

Member

Member

6 points

15 Posts

Issue with datagrid Silverlight Beta 2

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
lee_sl

Contributor

Contributor

2992 points

585 Posts

Re: Issue with datagrid Silverlight Beta 2

I think this is a bug, which was discussed a couple of weeks back. cannot find the actual post

----------------------------------------------
Available for consulting in Dallas, TX
http://leeontech.wordpress.com/

Raguvind
Raguvind

Member

Member

6 points

15 Posts

Answered Question

Re: Issue with datagrid Silverlight Beta 2

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.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities