Updating Rad grid in for loop

1 posts, 0 answers
  1. KARLIDAG
    KARLIDAG avatar
    1 posts
    Member since:
    Feb 2016

    Posted 16 Feb 2017 Link to this post

    Hello, 

     

    I have  a button , ajaxpanel and grid . On button Click a for loop is working.  Data is binding when for loop ends. But I want to update grid when each data added to searchlist. What I am not doing?

    Thanks

     

     

    List<SearchResult> results;

      protected void RadButton1_Click(object sender, EventArgs e)
        {

    results=new List<SearchResult> ();

     for (int i = 0; i < 100; i++)
            {

    SearchResult sr=new SearchResult();

     

    // Here call a web service and getdata.

    sr.ServiceName=services[i];

    sr.Data=webresponse.Data;

    results.add(sr);

    Radgrid1.datasource=results;

    Radgrid1.databind();
            }

     

    }

     

     

     

         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="RadButton1">
            <UpdatedControls>
               <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
            </UpdatedControls>
         </telerik:AjaxSetting>
         <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
               <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
            </UpdatedControls>
         </telerik:AjaxSetting>
      </AjaxSettings>
    </telerik:RadAjaxManager>

Back to Top