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

Why does this not work?

2 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dustin Dodson
Top achievements
Rank 1
Dustin Dodson asked on 11 Feb 2011, 04:51 PM
I have a grid that if it is empty I want to open up an insert form on page load and fill in some default values.

Most of the code works except for this.

rgvAgmtUsers.Items[0].FireCommandEvent("InitInsert", string.Empty);

Now this works if there is already a record in the grid, but if the grid is empty then it doesn't work.

after this is supposed to fire I am wanting to use the grd.MasterTableView.GetInsertItem() to grab controls and set default values.

Any ideas?

Thanks,

Dustin

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 16 Feb 2011, 11:09 PM
Hello Dustin,

Please try the following - this should work even if your RadGrid is empty:
rgvAgmtUsers.MasterTableView.IsItemInserted = true;
rgvAgmtUsers.Rebind();

Regards,
Daniel
the Telerik team
0
Simone
Top achievements
Rank 1
answered on 13 Apr 2012, 08:26 PM
deleted
Tags
Grid
Asked by
Dustin Dodson
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Simone
Top achievements
Rank 1
Share this question
or