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

Why does Add new record clear but not disappear?

1 Answer 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 06 Jun 2012, 03:46 PM
When trying to clear the radgrid, if the edit command is open when clearing it will clear and disappear. When the Add new record control is open, it clears but does not disappear. Is there any reason for why that is, and if so is there anyway to change it so it disappears as well?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jun 2012, 05:53 AM
Hello Erik,

I suppose you are clearing the grid in a button click. Here is the sample code that I tried based on your scenario.
C#:
protected void Button1_Click(object sender, EventArgs e)
{
  RadGrid1.DataSource = new string[] { };
  foreach (GridDataItem item in RadGrid1.Items)
  {
    RadGrid1.MasterTableView.IsItemInserted = false;
  }
    RadGrid1.Rebind();
}

Thanks,
Shinu.
Tags
Grid
Asked by
Erik
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or