Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
128 views

I've recently noticed the this causes the loading panel to not work properly, which is not a big deal, but now I have run into a problem with getting a radcombobox to work, so I need to figure out how to fix this.

The code in this user control works fine if I hardcode the control onto the page. It quits working properly (especially the radComboBox), once I change the user control to being dynamically added.

I tried adding the ajaxsettings from the code behind on page_load, according to this example: http://www.telerik.com/help/aspnet-ajax/ajax-user-controls.html, but this also stops working when placed on a user control that is added at runtime.

The code below is simplified to have a workable example.  Thank you for your help.

USER CONTROL ASCX CODE

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ctrlTest.ascx.cs" Inherits="ctrlTest" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<telerik:RadAjaxManager EnableAJAX="true" ID="RadAjaxManagerlvReviews" runat="server"
    <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="pGrid"
                <UpdatedControls
                    <telerik:AjaxUpdatedControl ControlID="pGrid"  LoadingPanelID="RadAjaxLoadingPanelCESearch"   /> 
                </UpdatedControls
            </telerik:AjaxSetting
             <telerik:AjaxSetting AjaxControlID="btnViewAllCECourses"
                <UpdatedControls
                    <telerik:AjaxUpdatedControl ControlID="pGrid"  LoadingPanelID="RadAjaxLoadingPanelCESearch"   /> 
                    <telerik:AjaxUpdatedControl ControlID="pSearch"    /> 
                </UpdatedControls
            </telerik:AjaxSetting
            <telerik:AjaxSetting AjaxControlID="btnSearchCECourses"
                <UpdatedControls
                    <telerik:AjaxUpdatedControl ControlID="pGrid"  LoadingPanelID="RadAjaxLoadingPanelCESearch"   /> 
                    <telerik:AjaxUpdatedControl ControlID="pSearch"    /> 
                </UpdatedControls
            </telerik:AjaxSetting
    </AjaxSettings>        
    </telerik:RadAjaxManager>
 
 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelCESearch" runat="server" Height="75px" Width="75px" Transparency="50" InitialDelayTime="0" >
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'  style="border: 0px;" />
 </telerik:RadAjaxLoadingPanel>
 
<asp:Panel ID="pSearch" runat="server">
  <telerik:radcombobox runat="server"  id="radCategories" ShowToggleImage=true Width="195px"  />
               
                    <asp:Button ID="btnSearchCECourses" runat="server" Text="Search Courses" OnClick="btnSearchCECourses_Click" CausesValidation="False" BWidth="MedLarge" Height="27px" style="font-size:12px;"   />
                   <asp:Button ID="btnViewAllCECourses" runat="server" Text="ViewAllCourses" OnClick="btnViewAllCECourses_Click" CausesValidation="False" BWidth="MedLarge" Height="27px" style="font-size:12px;"   />
                      
</asp:Panel>                   
                     
<asp:Panel ID="pGrid" runat="server">
    <telerik:RadListView ID="lvCEResults" runat="server"
            OnNeedDataSource="lvCEResults_NeedDataSource"
            AllowCustomPaging="true" AllowPaging="true" ItemPlaceholderID="phRadListView"
            Width="760px"
            >
             <LayoutTemplate>
                        <telerik:RadDataPager ID="RadDataPagerTop"  runat="server" IsTotalItemCountFixed="True" Skin="Windows7"  CssClass="Custom">
                             <Fields>
                                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                                    <telerik:RadDataPagerButtonField FieldType="Numeric" />
                                    <telerik:RadDataPagerButtonField FieldType="NextLast" />
                            </Fields>        
                         </telerik:RadDataPager>
                        <div style="height:10px"></div>
                         <asp:PlaceHolder ID="phRadListView" runat="server"></asp:PlaceHolder>
                          
                           <telerik:RadDataPager ID="RadDataPagerBottom" runat="server" IsTotalItemCountFixed="True" Skin="Windows7"  CssClass="Custom">
                             <Fields>
                                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                                    <telerik:RadDataPagerButtonField FieldType="Numeric" />
                                    <telerik:RadDataPagerButtonField FieldType="NextLast" />
                            </Fields>        
                         </telerik:RadDataPager>
                    </LayoutTemplate>
                     
                        <ItemTemplate>
                             <table>
                                <tr>
                                    <td><%#Eval("course_id") %></td>
                                    <td><%#Eval("description") %></td>
                                </tr>
                            </table>
                         </ItemTemplate>
                    </telerik:RadListView>
 
 
 
</asp:Panel>

USER CONTROL CODE BEHIND

public partial class ctrlTest : System.Web.UI.UserControl
{
     
    DataTable dt = new DataTable();
 
    protected void Page_Load(object sender, EventArgs e)
    {
        CreateCategoryData();
    }
 
    protected void lvCEResults_NeedDataSource(object source, RadListViewNeedDataSourceEventArgs e)
    {
        CreateCEData();
        lvCEResults.VirtualItemCount = 30;
        lvCEResults.DataSource = dt;
    }
 
 
    private void CreateCEData()
    {
        dt.Columns.Add("course_id");
        dt.Columns.Add("description");
 
        for (int i = 0;i <=30;i++)
        {
            dt.Rows.Add(i,"desc" + i);
        }
 
    }
 
    private void CreateCategoryData()
    {
        DataTable dtCategories = new DataTable();
        dtCategories.Columns.Add("category_id");
        dtCategories.Columns.Add("description");
 
        for (int i = 1; i <= 30; i++)
        {
            dtCategories.Rows.Add(i, "category_" + i);
        }
 
        radCategories.Items.Add(new RadComboBoxItem("AllCategories", "0"));
 
        foreach (DataRow dr in dtCategories.Rows)
        {
            radCategories.Items.Add(new RadComboBoxItem(dr["description"].ToString(), dr["category_id"].ToString()));
        }
 
    }
 
    protected void btnSearchCECourses_Click(object sender, System.EventArgs e)
    {
            lvCEResults.CurrentPageIndex = 0;
            lvCEResults.Rebind();
         
    }
 
    protected void btnViewAllCECourses_Click(object sender, EventArgs e)
    {
            radCategories.SelectedValue = "0";
            lvCEResults.CurrentPageIndex = 0;
            lvCEResults.Rebind();
    }
 
 
}


Page code:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="UC" src="ctrlTest.ascx" TagName="TEST" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div>
                <asp:Panel ID="ph" runat="server" EnableViewState=true />
    </div>
    </form>
</body>
</html>

Page code behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ctrlTest ucSearchResults = (ctrlTest)LoadControl("ctrlTest.ascx");
        ph.Controls.Add(ucSearchResults);
    }
}





Angie
Top achievements
Rank 1
 answered on 06 Dec 2011
3 answers
125 views

Hello,

I have a 3-tier radgrid and I am using the DetailTableDataBind to set the SelectParameters of my ObjectDataSources.  I am having trouble on the third tier accessing the information correctly.  The data keys on the third tier contain all of the IDs I need for the datasource, but I could also get the keys from the first and second tier as they are the same.  But I cannot seem to get the syntax correct to do this.  My aspx and vb code are below.

ASPX:

<telerik:RadGrid ID="gvSites" DataSourceID="odsSiteList" runat="server" AutoGenerateColumns="False" GridLines="None">
    <MasterTableView DataSourceID="odsSiteList" DataKeyNames="ID" Name="Sites" EditMode="EditForms">                
        <DetailTables>
            <telerik:GridTableView CssClass="detail_table" DataSourceID="odsCategoryList" AutoGenerateColumns="false" DataKeyNames="ID" Name="Categories" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add Category">
                <DetailTables>
                    <telerik:GridTableView CssClass="detail_table" DataSourceID="odsItemList" AutoGenerateColumns="false" DataKeyNames="Site_ID,Item_ID,Category_ID" Name="Items" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add Item">

VB:

Private Sub gvSites_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles gvSites.DetailTableDataBind
    Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
    If "Categories".Equals(e.DetailTableView.Name) Then
        odsCategoryList.SelectParameters("SiteID").DefaultValue = dataItem.GetDataKeyValue("ID").ToString()
    End If
    If "Items".Equals(e.DetailTableView.Name) Then
        odsItemList.SelectParameters("CategoryID").DefaultValue = dataItem.GetDataKeyValue("ID").ToString()
        odsItemList.SelectParameters("SiteID").DefaultValue = ???
    End If
End Sub

So my issue here is getting the SiteID.  It is the DataKey on the first-tier and it is also one of the DataKeys on the third-tier but I am not sure how to access it.  I either need to get the SiteID from the current levels ("Items") DataKeys or get the parent of the parent.

Thank you,

Steve
Stephen Giordano
Top achievements
Rank 1
 answered on 06 Dec 2011
2 answers
123 views
I build a rather large multi-tier tree list that represents a large checklist. The original intent was to render the whole checklist and let the user scroll through as they complete. Each item in the tree list contains text, and one or more input's ( textbox, checkbox, radio). When a user completes the checklist item, they press the "Confirm" button within that tree list row.

My problem is, any post-back seems to rebuild the whole tree. What are my options, to rebuild just the items within the tree list row? I'm not against using a DetailTemplate and ditching the 'columns' of the list all together. For that matter, i'm open to Treeview.

If I wrap my item level controls in an UpdatePanel will that allow me a finer resolution during postback? Can I have an update panel within a Cell or DetailTemplate with a postback button that doesn't force the whole tree to postback?

One option is to not postback at all, and keep track of the state client-side until they click some master 'I'm done" button, but the worse case scenario there is every response is lost to an exception, power loss, or closing the browser window.

Any suggestions?
Frank
Top achievements
Rank 1
 answered on 06 Dec 2011
2 answers
143 views
Hello,

how can i hide the Columns-Entry (see the Screenshot in Attachment) in the Header-Context-Menu?

Best Regards

Thomas
Kevin
Top achievements
Rank 2
 answered on 06 Dec 2011
1 answer
44 views
Is there a way that I can view the XHTML that is generated and used for the exportToPdf?  This will help me get the page to look the way I want it to.  Thanks
Phillip
Top achievements
Rank 1
 answered on 06 Dec 2011
3 answers
454 views
Hello All,

I am trying to use the RadTreeView for a web application that i am building. I am using the TreeView to bind with a Table. Currently when i first Click on a button, the table gets populatd with some information. Once that process is completed the RadTreeView renders and displays correctly.

My Problem is when i enter something else into the text box and click on the button. The Table which is bound to the RadTreeView changes because it needs to display different information, the problem is that the treeview does not get updated with the new data that is present in the table.

Can someone Please let me know how i can have the treeview refresh on a click event.

Thanks

Nitin
Nikolay Tsenkov
Telerik team
 answered on 06 Dec 2011
1 answer
38 views
Hi Telerik Admin,

I am using Telerik RadSchedular Version 2011.2.915.40.
When i navigate to a future date in Month View i.e. Date after 20th Feb 2017, then only date header remained visible and Body part gets disappeared.
Please suggest a way out to resolve this issue.
I have attached screenshot of the same for your reference.

I tried by changing my system date to 20th Feb, 2017, and got the same issue.

Thanks.
Ivana
Telerik team
 answered on 06 Dec 2011
2 answers
65 views
Hi,
I need to change the Calendar FastNavigation buttons width, because when I use the Office2007 skin, the buttons will be not shown fine. The buttons width are equal to the text width. Ther is no padding inside?
The attached screenshot demonstrates this.

How to fix this.

Regards,
Ralf
Ralf
Top achievements
Rank 1
 answered on 06 Dec 2011
1 answer
81 views
I recently downloaded ASP.Net AJAX controls and trying to create a custom webpart with RagGrid binding to SQL Server table. When I try to deploy the package to SharePoint 2010 site, I get the following error:

Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified.

I tried adding the Telerik.Web.UI.dll to web apps Bin folder but that didn't help either.

The version of Telerik.Web.Ui.dll is 2011.3.1115.35.
Tsvetoslav
Telerik team
 answered on 06 Dec 2011
2 answers
63 views
Hi,

I am interested to know if is it possible to dynamically assign the ClientEvent method for "OnMasterTableViewCreated" in either through code behind or javascript. If anyone has any ideas at all, please help me.

Thanks,
DJ
DJ
Top achievements
Rank 1
 answered on 06 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?