FlexGrid CollectionViewItemResult error message

Posted by: info on 2 October 2017, 6:55 pm EST

  • Posted 2 October 2017, 6:55 pm EST

    Hi,

    when an error occurs with the Create, Update, or Delete methods, you receive a alert that show the error message.

    It would be possible to hide the alert and display that error, not in grid but in html, for example in a div?

    Eg:

    # error message </ div>

            @ (Html.C1 (). FlexGrid (). Id ( "data_grid")
                  .SelectionMode (SelectionMode.Row)
                  .AllowSorting (true)
                  .Filterable ()
                  .Height (450)
                  .Bind (b =>
                  {
                      b.Bind (Url.Action ( "RemoteBind_Read"));
                      b.Create (Url.Action ( "GridCreate"));
                      b.Update (Url.Action ( "GridUpdate"));
                      b.Delete (Url.Action ( "GridDelete"));
                  })
                  .AutoGenerateColumns (false)
                  .Columns (bl =>
                  {
                      bl.Add (cb => cb.Binding ("Id"). Visible (false));
                      bl.Add (cb => cb.Binding ("Note"). Width ("*") IsReadOnly (true));
                  })
                  .ItemFormatter ( "gridFormatter"))
    

    Thank’s,

    Marco

  • Posted 4 October 2017, 9:12 pm EST

    Hi Marco,

    If we are correct, you are using BuiltInValidation same as given below sample.

    http://demos.componentone.com/ASPNET/MVCExplorer/FlexGrid/BuiltInValidation

    If yes, you can set showErrors to false which will stop highlights error. Now, you need to create a method which will return the message for given cell. This method should be called in beginningEdit method and show the message in Div specified by you.

    You need to handle cellEditEnding event to keep the cell in edit mode if the cell new value is invalid.

    Thanks,

    Manish Kumar Gupta

  • Posted 5 October 2017, 2:25 pm EST

    Hi Marco,

    You need to handle these events using client or use onClientBeginningEdit and onClientCellEditEnding.

    Thanks,

    Manish Kumar Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels