Loding with User control

4 posts, 0 answers
  1. Prabha
    Prabha avatar
    26 posts
    Member since:
    Dec 2013

    Posted 18 Aug 2014 Link to this post

    Hi All,

    i have designed my webpage with a raddropdowntree and a RadComboBox . when im clicking on that raddropdowntree , 'EntryAdded' event will fire and a RadComboBox will load. In this event , the page will be blinking. So that i have trying to avoid that. if i will use RadAjaxManager means, the RadDropDownTree  canot be load and accessible. Anybody tell me the solution that, how to avoid flickering  using Rad in webpage while postback. below is the sample code.
    <rad:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
           <rad:AjaxSetting AjaxControlID="rddtArea">
                <UpdatedControls>
                    <rad:AjaxUpdatedControl ControlID="rcmbName">
                </UpdatedControls>
            </rad:AjaxSetting>
        </AjaxSettings>
    </rad:RadAjaxManager>
    <rad:RadSplitter runat="server" ID="RadSplitter1" Width="100%" BorderSize="0" BorderStyle="None"
        PanesBorderSize="0" Height="100" Orientation="Horizontal">
        <rad:RadPane ID="RadPane1" runat="server" Height="100%">
       <rad:RadDropDownTree ID="rddtArea" runat="server" DropDownSettings-CloseDropDownOnSelection="true"
                            OnEntryAdded="rddtArea_EntryAdded" EnableFiltering="true" FilterSettings-Highlight="Matches"
                            Skin="Outlook" DropDownSettings-Height="100" AutoPostBack="true">
                        </rad:RadDropDownTree>
      <rad:RadComboBox ID="rcmbworkflowtemplate" runat="server" DataValueField="MOCID"
                            AppendDataBoundItems="false" DataTextField="MOCTitle" AutoPostBack="true" OnSelectedIndexChanged="rcmbworkflowtemplate_SelectedIndexChanged">
                      </rad:RadComboBox>
      </rad:RadPane>
    </rad:RadSplitter>












  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Aug 2014 in reply to Prabha Link to this post

    Hi Prabha,

    Please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rdroptreeEmployees">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rcboListItems" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadDropDownTree ID="rdroptreeEmployees" runat="server" DataFieldID="EmployeeID" DataValueField="EmployeeID" AutoPostBack="true" DataFieldParentID="ReportsTo" DataTextField="LastName" DataSourceID="sqldsEmployees" OnEntryAdded="rdroptreeEmployees_EntryAdded">
    </telerik:RadDropDownTree>
    <telerik:RadComboBox ID="rcboListItems" runat="server">
    </telerik:RadComboBox>

    C#:
    protected void rdroptreeEmployees_EntryAdded(object sender, Telerik.Web.UI.DropDownTreeEntryEventArgs e)
    {
        String connectionstring = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection sqlconn = new SqlConnection(connectionstring);
        SqlDataAdapter adapter = new SqlDataAdapter();
        adapter.SelectCommand = new SqlCommand("SELECT * from EmployeeTerritories where EmployeeID='"+e.Entry.Value+"' ", sqlconn);
        DataTable data = new DataTable();
        sqlconn.Open();
        try
        {
            adapter.Fill(data);
        }
        finally
        {
            sqlconn.Close();
        }
        rcboListItems.DataSource = data;
        rcboListItems.DataTextField = "TerritoryID";
        rcboListItems.DataValueField = "EmployeeID";
        rcboListItems.DataBind();
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Prabha
    Prabha avatar
    26 posts
    Member since:
    Dec 2013

    Posted 18 Aug 2014 in reply to Princy Link to this post

    hi Princy,

    I have tried your code, but its not working in my end. Actually the Raddropdowntree should be load at Page_load itself. if i will use telerik:RadAjaxManager  means, Raddropdowntree  itself doesnot load at Page_load . (these controls are inside asp:Content, and it refer master page also. )
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 18 Aug 2014 in reply to Prabha Link to this post

    Hi Prabha,

    Such an issue is not expected. Try to add RadAjaxManager in the Master Page and RadAjaxManagerProxy in the content page. Please have a look into the sample code snippet which works fine at my end.

    MasterPage :
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    </telerik:RadAjaxManager>

    ContentPage:
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
        <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rdroptreeEmployees">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rcboListItems" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
        <telerik:RadDropDownTree ID="rdroptreeEmployees" runat="server" AutoPostBack="true"
            OnEntryAdded="rdroptreeEmployees_EntryAdded">
        </telerik:RadDropDownTree>
        <telerik:RadComboBox ID="rcboListItems" runat="server">
        </telerik:RadComboBox>
        <asp:SqlDataSource ID="sqldsEmployees" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [EmployeeID], [ReportsTo], [LastName] FROM [Employees]">
        </asp:SqlDataSource>
    </asp:Content>

    Content Page C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        rdroptreeEmployees.DataSourceID = "sqldsEmployees";
        rdroptreeEmployees.DataFieldID = "EmployeeID";
        rdroptreeEmployees.DataFieldParentID = "ReportsTo";
        rdroptreeEmployees.DataTextField = "LastName";
        rdroptreeEmployees.DataValueField = "EmployeeID";
        rdroptreeEmployees.DataBind();
    }
    protected void rdroptreeEmployees_EntryAdded(object sender, Telerik.Web.UI.DropDownTreeEntryEventArgs e)
    {
        String connectionstring = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection sqlconn = new SqlConnection(connectionstring);
        SqlDataAdapter adapter = new SqlDataAdapter();
        adapter.SelectCommand = new SqlCommand("SELECT * from EmployeeTerritories where EmployeeID='" + e.Entry.Value + "' ", sqlconn);
        DataTable data = new DataTable();
        sqlconn.Open();
        try
        {
            adapter.Fill(data);
        }
        finally
        {
            sqlconn.Close();
        }
        rcboListItems.DataSource = data;
        rcboListItems.DataTextField = "TerritoryID";
        rcboListItems.DataValueField = "EmployeeID";
        rcboListItems.DataBind();
    }

    Thanks,
    Princy.
Back to Top