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

Insert Commnad will not fire when data source is empty

3 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 1
Anton asked on 16 Jan 2009, 03:40 PM
I have a very strange problem, I have a RadGrid control that usues a  generic List<MyObject> as datasource, when the list contains records Insert commands fires fine, and displays insert form , but when the list is empty (Count=0), and grid.DataSource is therefore empty, Insert command will not fire, and will just refresh the page entering only Page_Load.

3 Answers, 1 is accepted

Sort by
0
Anton
Top achievements
Rank 1
answered on 19 Jan 2009, 02:13 PM
:bump:
Anyone ever encountered similar problem?
0
Accepted
Sebastian
Telerik team
answered on 19 Jan 2009, 02:20 PM
Hello Anton,

Can you please verify that you bind the grid using advanced binding with NeedDataSource event handling? This should ensure that the InsertCommand event will be raised as expected event when there are no records to be displayed in the grid. Also verify that you are using the latest release 2008.3.1314 of RadControls for ASP.NET AJAX.

Kind regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Anton
Top achievements
Rank 1
answered on 19 Jan 2009, 02:54 PM
This seams to be the problem, I am binding the grid on Page_Load, and NeedDataSource does not get fired in that case, did some tests, and when working with NeedDataSource event, Insert event works fine.
Tags
Grid
Asked by
Anton
Top achievements
Rank 1
Answers by
Anton
Top achievements
Rank 1
Sebastian
Telerik team
Anton
Top achievements
Rank 1
Share this question
or