Hiding insert mode

3 posts, 1 answers
  1. Vittorio
    Vittorio avatar
    5 posts
    Member since:
    Sep 2011

    Posted 19 Oct 2011 Link to this post



    My radgrid have AllowAutomaticInserts and AllowAutomaticUpdates set to True.
    Meanwhile user editing item, it is raised event that causes the end of editing item. In the Page PreRender, i wrote following code:


    if (!clauseEdit && dgImpegni.EditItems.Count > 0)
    {
    dgImpegni.EditItems[0].Edit = false;
    }
    dgImpegni.Rebind();


    Can i write similar code for the insert item ?

  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Oct 2011 Link to this post

    Hello Vittorio,

    You can try the following code snippet to hide the insert form.

    C#:
    if (radgrid1.MasterTableView.IsItemInserted == true)
      {
       radgrid1.MasterTableView.GetInsertItem().Display = false;
      }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vittorio
    Vittorio avatar
    5 posts
    Member since:
    Sep 2011

    Posted 21 Oct 2011 Link to this post

    Hello Princy,

    Thanks for the tip!!!

    I solved by setting the property to false Edit and performing rebind the datagrid:

    if (!vs_ToView && dgImpegni.EditItems.Count > 0)
    dgImpegni.EditItems[0].Edit = false;

    if (!vs_ToView && dgImpegni.MasterTableView.IsItemInserted)
    dgImpegni.MasterTableView.GetInsertItem().Edit = false;

    dgImpegni.Rebind();

    Hello,
    Vittorio
Back to Top