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

Adding Ajax to RadGrid breaks RadGrid1.SelectedItems

1 Answer 26 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 28 Nov 2012, 06:15 PM
Hi,

I have a grid with a checkbox column I am able to select multiple rows then click an itemcommand button that will run code for each selected row. The code below works great and I can process each selected row. The problem is that there is no visual indicator that the process is running and the users end up clicking the button two or three times. I am attempting to add the grid into the ajax manager (see below) when I do that, I do get the loading panel. The problem is that grdAvailableItems.SelectedItems is empty there are no selected items.
Any Ideas?  

Thanks,
Tom Usselman
protected void GrdAvailableItems_ItemCommand(object sender, GridCommandEventArgs e)
       {
           if (e.CommandName == "AddToQuote")
           {
               try
               {
                   bool renumber = false;
                   hdnAddAdditionalItems.Value = "Yes";
                   foreach (GridDataItem item in grdAvailableItems.SelectedItems)
                   {
                       int multiplier = Convert.ToInt16(item["multiplier"].Text);
                       Single curprice = Convert.ToSingle(item["curprice"].Text);

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
DefaultLoadingPanelID="RadAjaxLoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="grdAvailableItems">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grdQuoteItems" />
<telerik:AjaxUpdatedControl ControlID="grdAvailableItems"
LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 03 Dec 2012, 10:04 AM
Hello Thomas,

I suppose that the issue you are facing appears in case the user clicks several times to select different items before the previous request has finished.
By design ASP.NET AJAX Framework cancels the ongoing ajax request if you try to initiate another one prior to receiving the response from the first one. By setting the RequestQueueSize property to a value greater than zero, you are enabling the queueing mechanism of RadAjax, that will allow you to complete the ongoing request and then initiate the pending requests in the control queue.
Give this a try and let me know if it works.

Kind regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Ajax
Asked by
Thomas
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or