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

Updating Rad grid in for loop

0 Answers 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
KARLIDAG
Top achievements
Rank 1
KARLIDAG asked on 17 Feb 2017, 01:44 AM

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>

No answers yet. Maybe you can help?

Tags
Grid
Asked by
KARLIDAG
Top achievements
Rank 1
Share this question
or