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

Cannot set DataRow as Data, Try setting DataRowView

Hi,

 I have a grid bounded to the datatable. There is a new row enabled.
 In first column I have a textbox in second one there is a checkbox.
 When I write in the textbox and hit enter, everything is fine. But I want to fill the checkbox. If I click on the cell and then on the textbox, it's fine also. But when I directly click on the checkbox I have the subjects exception. I have seen that you make the direct checking is the Data property typeof DataRow. But how can I do it manually. I have to admit that this is the worst grid control I have ever seen.

System.InvalidOperationException: Cannot set DataRow as Data, Try setting DataRowView
   at Syncfusion.Windows.Data.RecordEntry.set_Data(Object value)
   at Syncfusion.Windows.Data.RecordEntry..ctor(NodeEntry parent, Int32 level, Object data)
   at Syncfusion.Windows.Controls.Grid.GridDataRecord..ctor(Object data, GridDataTable parentTable)
   at Syncfusion.Windows.Controls.Grid.GridDataTableModel.<CreateCollectionViewAdv>b__7c(Object rec, ICollectionViewAdv parentView)
   at Syncfusion.Windows.Controls.Grid.GridDataTableCollectionViewWrapper.CreateRecordEntry(Object data)
   at Syncfusion.Windows.Data.EnumerableRecordsWrapper.CreateRecord(Object data)
   at Syncfusion.Windows.Data.EnumerableRecordsWrapper.CreateRecordEntry(Object data)
   at Syncfusion.Windows.Controls.Grid.GridCellDataBoundTemplateRenderer.ProvideDataWrapperInstance(GridDataCellBoundWrapper wrapperInstance, GridRenderStyleInfo style)
   at Syncfusion.Windows.Controls.Grid.GridCellDataBoundTemplateRenderer.OnInitializeContent(GridCell uiElement, GridRenderStyleInfo style)
   at Syncfusion.Windows.Controls.Grid.GridVirtualizingCellRendererBase`1.InitializeContent(T uiElement, GridRenderStyleInfo cellInfo)
   at Syncfusion.Windows.Controls.Grid.GridVirtualizingCellRenderer`1.RefreshContent()
   at Syncfusion.Windows.Controls.Grid.GridCurrentCell.CreateCurrentCellUIElements()
   at Syncfusion.Windows.Controls.Grid.GridCurrentCell.BeginEdit(Boolean focusCellUIElement)
   at Syncfusion.Windows.Controls.Grid.GridCurrentCell.BeginEditHelper(GridActivateCurrentCellOptions activateOptions)
   at Syncfusion.Windows.Controls.Grid.GridCurrentCell.Activate(RowColumnIndex cellRowColumnIndex, GridActivateCurrentCellOptions activateOptions)
   at Syncfusion.Windows.Controls.Grid.GridCurrentCell.Activate(Int32 rowIndex, Int32 columnIndex, GridActivateCurrentCellOptions activateOptions)
   at Syncfusion.Windows.Controls.Grid.GridCurrentCell.MoveTo(Int32 rowIndex, Int32 columnIndex, GridActivateCurrentCellOptions activateOptions)
   at Syncfusion.Windows.Controls.Grid.GridCellRendererBase.OnPreviewGotKeyboardFocus(Object sender, RoutedEventArgs e)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
   at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
   at System.Windows.UIElement.Focus()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonDown(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntA first chance exception of type 'System.InvalidOperationException' occurred in Syncfusion.Linq.Base.dll


1 Reply

RG Rajasekar G Syncfusion Team February 5, 2013 04:31 AM UTC

Hi Michal, 

Sorry for the inconvenience caused. We have tested the reported issue in different scenario but we are unable to reproduce the issue. Could you please check the below sample?

Sample: GridDataControlSample.zip 

We suspect you are using our grid in some other scenario, So If possible could you please modify our sample and revert us with replication procedure, that would be very helpful to resolve your problem earlier. 

Please let know if you have any queries. 

Thanks,

Rajasekar


Loader.
Live Chat Icon For mobile
Up arrow icon