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

Update command not firing properly if we load the radgrid dynamically

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Diptesh
Top achievements
Rank 1
Diptesh asked on 15 Jun 2011, 06:06 PM
Hi,

We are loading a rad grid dynamically on dropdown selection change event.
Everything works fine when number of rows in a grid are less than the pagesize.
When number of rows are more than the page size i.e. when we have more than one page update event is not getting fired.
It fires the ItemCommand event but in itemcommand event e.cancelled is coming as true.
Please check.

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 21 Jun 2011, 01:35 PM
Hello Diptesh,

We recieved an identical ticket through our support ticketing system, so I would like to ask you to continue our communication on the matter there. Thank you in advance for your understanding. 

For others who may experience similar problem, here is the reply from the support ticket:

Without looking at your code it is hard to tell what causes the issue because when creating a dynamic grid correctly there are no problems with its regular event sequence. Keep in mind that you should create the grid either on Page_Load or Page_Init - if the whole control is dynamically created preferrably on Page_Init. Instructions and sample code are available here.

If you want it to load only on a certain dropdown selection, you can first set its Visible property to false. This way you will prevent it from binding and firing the subsequent events. Then, on SelectedIndexChanged of the dropdown switch the visibility of the grid and call Rebind() upon it.

For your convenience, I have prepared a sample project demonstrating this approach. You can see that in it the UpdateCommand event is correctly fired - for simplicity I indicate this by just writing a line on the page from the event handler, a real update routine does not take place.

Greetings,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Diptesh
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or