This is a migrated thread and some comments may be shown as answers.

Hiding insert mode

2 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vittorio
Top achievements
Rank 1
Vittorio asked on 19 Oct 2011, 03:00 PM


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 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 Oct 2011, 02:13 PM
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.
0
Vittorio
Top achievements
Rank 1
answered on 21 Oct 2011, 09:19 AM
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
Tags
Grid
Asked by
Vittorio
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Vittorio
Top achievements
Rank 1
Share this question
or