RadGridView editing of filtered DataView

4 posts, 1 answers
  1. James
    James avatar
    9 posts
    Member since:
    Jul 2015

    Posted 04 May 2017 Link to this post

    I'm writing with regard to a problem I'm encountering when a user edits RadGridView data that has been filtered.

    The filtering is being done through a DataView expression, e.g.     CONVERT([NumberOfStaffAvailable],'System.Decimal')>=10

    The user then edits the NumberOfStaffAvailable field for one of the displayed rows to be less than 10, so that row is no longer valid as part of the filtered recordset.

    When the user presses the Enter key a NullReference exception is thrown, the callstack is listed below.

    I've tried calling SuspendLayout() and SuspendUpdate() in the CellBeginEdit event, and resuming them in the CellEndEdit event, but with no luck.

    I'd be grateful for any advice on how get around this problem,

    I'm using WinControls v. 2016.3.1024.40

    Thanks and kind regards

    James

    System.NullReferenceException: Object reference not set to an instance of an object.
       at Telerik.WinControls.UI.GridDataCellElement.set_Value(Object value)
       at Telerik.WinControls.UI.GridViewEditManager.EndEditCore(Boolean validate, Boolean cancel)
       at Telerik.WinControls.UI.GridViewEditManager.EndEdit()
       at Telerik.WinControls.UI.GridRowBehavior.ProcessEnterKey(KeyEventArgs keys)
       at Telerik.WinControls.UI.GridRowBehavior.ProcessKey(KeyEventArgs keys)
       at Telerik.WinControls.UI.BaseGridBehavior.ProcessKey(KeyEventArgs keys)
       at Telerik.WinControls.UI.BaseGridBehavior.ProcessKeyDown(KeyEventArgs keys)
       at Telerik.WinControls.UI.BaseGridEditor.OnKeyDown(KeyEventArgs keyEventArgs)
       at Telerik.WinControls.UI.RadTextBoxEditor.OnKeyDown(KeyEventArgs e)
       at Telerik.WinControls.UI.RadTextBoxEditor.TextBoxItem_KeyDown(Object sender, KeyEventArgs e)
       at System.Windows.Forms.KeyEventHandler.Invoke(Object sender, KeyEventArgs e)
       at Telerik.WinControls.RadItem.OnKeyDown(KeyEventArgs e)
       at Telerik.WinControls.UI.RadTextBoxItem.TextBoxControl_KeyDown(Object sender, KeyEventArgs e)
       at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
       at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
       at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
       at System.Windows.Forms.Control.WmKeyChar(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
       at System.Windows.Forms.TextBox.WndProc(Message& m)
       at Telerik.WinControls.UI.HostedTextBoxBase.WndProc(Message& message)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)










  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2841 posts

    Posted 09 May 2017 Link to this post

    Hi James,

    I am not sure how to reproduce this. Would it be possible for you to create a small project that reproduces it and send it to us?

    In addition, I suggest you try adding filter descriptors instead of filtering the view: Setting Filters Programmatically (simple descriptors).

    I am looking forward to your reply.
     
    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. James
    James avatar
    9 posts
    Member since:
    Jul 2015

    Posted 10 May 2017 in reply to Dimitar Link to this post

    Hi Dimitar,

    thanks a lot for your reply. As suggested I moved to using FilterDescriptors instead of using DataView.RowFilter to do filtering.

    This fixes the problem completely and wasn't too tricky to do, I did it before receiving your reply.

    Thanks again and kind regards

    James

     

     

     

  4. Dimitar
    Admin
    Dimitar avatar
    2841 posts

    Posted 11 May 2017 Link to this post

    Hello James,

    I am glad that this is working fine now. Do not hesitate to contact us if you have other questions.

    Regards,
    Dimitar
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top