How to set dynamically created Button as updated control in RadAjax manager?

2 posts, 0 answers
  1. Prava kafle
    Prava kafle avatar
    217 posts
    Member since:
    Apr 2010

    Posted 12 Nov 2010 Link to this post

    Hi,
    I am adding couple of buttons in a panel (Panel1) in default.aspx, I want to ajaxify the application by setting these dynamic buttons as triggers to update panel3 and Panel 4 in default.aspx page. I used following approach, but it didnot help. Can someone point  me what I am missing.
    Thanks,
    Prava


     

    Panel
      
       
      
      
      
    drilPanel = (Panel)WIMProject.ParentPage.FindControl("DrillBtnsPanel");
    for
      
       
      
    (int i = 0; i < rows.Count; i++) 
       
      
    {
      
       
      
      
      
    Button drillButton = new Button(); 
       
      
    drillButton.ID = rows[i][
      
      
      
    "relatename"].ToString(); 
       
      
    drillButton.Text = rows[i][
      
      
      
    "relatename"].ToString(); 
       
      
    drillButton.CssClass = 
      
      
      
    "DrillBtn"
       
      
    drillButton.Click+=
      
      
      
    new EventHandler(DrillButton_Click); 
       
      
    drillPanel.Controls.Add(drillButton);
      
       
      
       
      
      
      
       
      
    Panel dataEditPanel = (Panel)WIMProject.ParentPage.FindControl("DataEditPanel"); 
       
      
       
      
      
      
    Panel drillCounterPanel = (Panel)WIMProject.ParentPage.FindControl("DrillCounterPanel"); 
       
      
       
      
      
      
    // Create the ajax setting 
       
      
      
      
    Telerik.Web.UI.
      
    AjaxSetting searchAjaxSetting = new Telerik.Web.UI.AjaxSetting(); 
       
      
    searchAjaxSetting.AjaxControlID = drillButton.UniqueID;
      
       
      
      
      
    // Create the updated control 
       
      
      
      
    Telerik.Web.UI.
      
    AjaxUpdatedControl searchUpdatedControl = new Telerik.Web.UI.AjaxUpdatedControl(); 
       
      
    searchUpdatedControl.ControlID = dataEditPanel.UniqueID;
      
       
      
      
      
    // Create the updated control 
       
      
      
      
    Telerik.Web.UI.
      
    AjaxUpdatedControl searchUpdatedControl2 = new Telerik.Web.UI.AjaxUpdatedControl(); 
       
      
    searchUpdatedControl2.ControlID = drillCounterPanel.UniqueID;
      
       
      
       
      
      
      
    // Add the updated control to the setting 
       
      
      
      
    searchAjaxSetting.UpdatedControls.Add(searchUpdatedControl);
      
       
      
    // Add the updated control to the setting 
       
      
      
      
    searchAjaxSetting.UpdatedControls.Add(searchUpdatedControl2);
      
       
      
    // Add the setting to the ajax manager 
       
      
      
      
       
      
    RadAjaxManager radAjaxManager1 = (RadAjaxManager)WIMProject.ParentPage.FindControl("RadAjaxManager1"); 
       
      
    radAjaxManager1.AjaxSettings.Add(searchAjaxSetting);

     

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 15 Nov 2010 Link to this post

    Hi Prava,

    Please refer to the following help topics:

    http://www.telerik.com/help/aspnet-ajax/ajxaddajaxsettingsprogrammatically.html
    http://www.telerik.com/help/aspnet-ajax/ajxusercontrols.html

    Best wishes,
    Maria Ilieva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top