Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
266 views
Hi,

I use LoadControl in CodeBehind, like this: RadMenuItem.Controls.Add(LoadControl("/login.ascx"));

It work out fine, and my login control are now inside r.a.d.menu.

BUT - if /login.ascx fail to login, I would like the r.a.d.menu item to open again and show the user, that a login problem occurred.

AND - if I implement an UpdatePanel in my /login.ascx file, it will fail with:
Cannot unregister UpdatePanel with ID '' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
Parameter name: UpdatePanel


Does anyone have solutions to these problems?
Felipe
Top achievements
Rank 1
 answered on 29 Jul 2011
2 answers
110 views
I have this

protected void MatrixGridNeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            _matrixGrid.DataSource = CommonGrid.ListDocuments;
        }

Sometime CommonGrid.ListDocuments is Null... I need in this case that ""No records to display."  message appear.
But doesnt show it in Grid.
I set   _matrixGrid.MasterTableView.EnableNoRecordsTemplate = true;
I created the grid programmatically.


July
Top achievements
Rank 2
 answered on 29 Jul 2011
1 answer
396 views
The Intranet of my company is quite slow, it takes 4 seconds to download the telerik.web.ui.webresource.axd resource :(
How could I reduce that?
- Is it possible to cache this resource?
- I thought about setting Telerik.EnableEmbeddedScripts to false in the web.config file, and then adding all scripts in RadScriptManager (as explained here: http://www.telerik.com/help/aspnet-ajax/introduction-disabling-embedded-resources.html ). Then I could set Expires header on the script folder so they will be downloaded only once.

What's the best solution?
Simon
Telerik team
 answered on 29 Jul 2011
1 answer
139 views
Dear All, 

This is my first post here. 

We have a 4 level hierarchical data. The data for all the 4 levels is loaded from javascript using page methods. 
The data hierarchy is as follows. Specimen -->Part-->Block-->Slide.

I could get the Specimen and the Part thing working. I am stuck on loading the 3rd level (the Block Data). 

Here are the issues I am facing:-
  1. If I provide the DataKeyNames and ClientDataKeyNames property on the grid for Parts, the rendering fails with the message 'PartID is not a column or a relation in the table'. I cannot even provide the HierarchyLoadMode on the grid.  Without the hierarchyLoadMode, when the Part is expanded, the hierarchyExpanding event does not fire. Instead the command event fires. 

Here is the file. If needed I can post a subset of the application
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
         
     
    <script type="text/javascript" language="javascript">
 
        function createCallBack(tableView, div) {
            return function(result) {
                if (result != null && div != null) {
                    div.style.display = "block";
                }
 
                tableView.set_dataSource(result);
                tableView.dataBind();
                if (result.count != null) {
                    tableView.set_virtualItemCount(result.Count);
                }
            };
        }
 
 
        function createPartsCallBack(tableView, div) {
            return function(result) {
                if (result != null && div != null) {
                    div.style.display = "block";
                }
                tableView.set_dataSource(result.Parts);
                tableView.dataBind();
                if (result.Count != null) {
                    tableView.set_virtualItemCount(result.Count);
                }
            };
        }
         
        /*functions for specimen History Start*/
        function loadSpecimenHistory() {
            var tblView = $find("<%=radGridHistory.ClientID %>").get_masterTableView();
            var divHistory = document.getElementById('divHistory');
 
            //Pass in the selected Specimen Id
            var result = PageMethods.FindSpecimen(20, createCallBack(tblView, divHistory));
        }
 
        function radGridHistory_hierarchyExpanding(sender, args) {
            var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
 
            if (firstClientDataKeyName == "SpecimenID") {
                var tblView = $find("<%= radGridHistory.Items(0).ChildItem.NestedTableViews(0).ClientID%>");
                var currentPageIndex = tblView.get_currentPageIndex();
                var pageSize = tblView.get_pageSize();
                var sortExpressionsAsSQL = tblView.get_sortExpressions().toString();
                var filterExpressionsAsSQL = tblView.get_filterExpressions().toString();
                var result = PageMethods.FindSpecimenHistoryParts(args.getDataKeyValue(firstClientDataKeyName),
                                                                   currentPageIndex * pageSize,
                                                                   pageSize,
                                                                   sortExpressionsAsSQL,
                                                                   filterExpressionsAsSQL,
                                                                   createPartsCallBack(tblView,null));
            }
        }
 
        //Grid command invoked (sort)
        function radGridHistory_command(sender, args) {
            args.set_cancel(true);
            if (args.get_commandName() == "ExpandCollapse") {
                var tblView = $find("<%= radGridHistory.Items(0).ChildItem.NestedTableViews(0).ClientID%>");
            }
 
 
            var tblView = args.get_tableView();
            var tableName = tblView.get_name()
            var specimenId = sender.get_masterTableView().get_dataItems()[0].get_dataItem().SpecimenID;
            if (tableName == "Parts") {
                var pageSize = tblView.get_pageSize();
                var sortExpressionsAsSQL = tblView.get_sortExpressions().toString();
                var filterExpressionsAsSQL = tblView.get_filterExpressions().toString();
                var currentPageIndex = tblView.get_currentPageIndex();
                var result = PageMethods.FindSpecimenHistoryParts(specimenId,
                                                                   currentPageIndex * pageSize,
                                                                   pageSize,
                                                                   sortExpressionsAsSQL,
                                                                   filterExpressionsAsSQL,
                                                                   createPartsCallBack(tblView, null));
            }
        }
 
 
        /*functions for specimen History END*/
 
         
     
     
    </script>
    </telerik:RadCodeBlock>
 
<div id="divHistory" style="display:none">
        <telerik:RadGrid ID="radGridHistory" runat="server" EnableViewState="False" AllowSorting="True"
            GridLines="None" ShowStatusBar="false" >
            <ClientSettings AllowExpandCollapse="true">
                <ClientEvents OnHierarchyExpanding="radGridHistory_hierarchyExpanding" OnCommand="radGridHistory_command" />
            </ClientSettings>
            <PagerStyle Mode="NumericPages" AlwaysVisible="true"></PagerStyle>
            <MasterTableView AllowMultiColumnSorting="false" TableLayout="Fixed" HierarchyLoadMode="Client"
                DataKeyNames="SpecimenID" ClientDataKeyNames="SpecimenID" AllowPaging="false"
                Width="100%">
                <DetailTables>
                    <telerik:GridTableView Width="100%" Name="Parts" PageSize="4" AllowPaging="true"
                        AllowCustomPaging="true" >
                        <DetailTables>
                            <telerik:GridTableView Width="100%" Name="Blocks" PageSize="4" AllowPaging="true"
                                AllowCustomPaging="true" >
                                <Columns>
                                    <telerik:GridBoundColumn SortExpression="BlockID" HeaderText="BlockID" HeaderButtonType="TextButton"
                                        DataField="BlockID" UniqueName="BlockID">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                 
                            </telerik:GridTableView>
                        </DetailTables>
                        <Columns>
                            <telerik:GridBoundColumn SortExpression="PartID" HeaderText="PartID" HeaderButtonType="TextButton"
                                DataField="PartID" UniqueName="PartID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Name" HeaderText="Part Name" HeaderButtonType="TextButton"
                                DataField="Name">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <PagerStyle AlwaysVisible="True" Mode="NumericPages"></PagerStyle>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="SpecimenID" HeaderText="SpecimenID" HeaderButtonType="TextButton"
                        DataField="SpecimenID" />
                    <telerik:GridBoundColumn SortExpression="SpecimenName" HeaderText="Specimen Name"
                        HeaderButtonType="TextButton" DataField="SpecimenName" />
                </Columns>
                <PagerStyle AlwaysVisible="True"></PagerStyle>
            </MasterTableView>
        </telerik:RadGrid>
    </div>


Would really appreciate if someone can look into this and help me out.

Thanks in advance.

Maria Ilieva
Telerik team
 answered on 29 Jul 2011
1 answer
167 views
Hi forum!

I'm trying to make a 3 division panelbar for the purpose os recreating a simple webmail. The first division is for the user write the message and choose the destinations, the second division is for reading selected messages and the third is for showing the messages with a radgrid and the option to see between received and sent. 
In the first division i have 2 labels ("For:" and "From:"), 2 RadTextBox("From" that has enabled=false and "Message" that has type=Multyline) and 1 RadComboBox(that serves as a "For" selector). I have set their position with property style ( using top left width and height) and i did so with percentage values and pixel values and neither got right. For position i have tried them all and nothing thought position relative putted these items inside the radpanel.
Where i have the items in inside  the respective telerik:raspanelitem then inside items then inside telerik:radpanelitem then inside itemtemplate ( as seen in this demo -> telerik demo of nested controls inside radpanelbar) then inside a div (i also tried without the div).
My RadPanelBar is inside a div witch width and height are static in pixel values, below follows the code of mypanelbar and his superior container
<div style="border-style:inset; width:1093px; height:856px; left:50%; top:130px; margin-left:-546px; position:absolute">
            <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Height="100%" 
                Skin="Simple" Width="100%" style="position:absolute;">
                <Items>
                    <telerik:RadPanelItem runat="server" Text="Escrever Mensagem" 
                        ChildGroupHeight="282px" Expanded="True">
                        <Items>
                            <telerik:RadPanelItem Value="escrever" runat="server">
                                <ItemTemplate>
                                <div style="position:relative">
                                    <telerik:RadTextBox ID="RadTextBox1" runat="server" 
                                        style="z-index: 1; left: 50%; top: 1%; position: relative;" 
                                        Height="277px" TextMode="MultiLine" Width="50%">
                                        <PasswordStrengthSettings ShowIndicator="False" CalculationWeightings="50;15;15;20" PreferredPasswordLength="10" MinimumNumericCharacters="2" RequiresUpperAndLowerCaseCharacters="True" MinimumLowerCaseCharacters="2" MinimumUpperCaseCharacters="2" MinimumSymbolCharacters="2" OnClientPasswordStrengthCalculating="" TextStrengthDescriptions="Very Weak;Weak;Medium;Strong;Very Strong" TextStrengthDescriptionStyles="riStrengthBarL0;riStrengthBarL1;riStrengthBarL2;riStrengthBarL3;riStrengthBarL4;riStrengthBarL5;" IndicatorElementBaseStyle="riStrengthBar" IndicatorElementID=""></PasswordStrengthSettings>
                                    </telerik:RadTextBox>
                                    <asp:Label ID="Label2" runat="server" Text="DE:" 
                                        style="z-index: 1; left: 90%; top: 10%; position: relative"></asp:Label>
                                    <asp:Label ID="Label3" runat="server" Text="PARA:" 
                                        style="z-index: 1; left: 90%; top: 20%; position: relative"></asp:Label>
                                    <telerik:RadTextBox ID="RadTextBox2" runat="server" Width="20%"
                                        style="z-index: 1; left: 80%; top: 10%; position: relative">
                                        <PasswordStrengthSettings ShowIndicator="False" CalculationWeightings="50;15;15;20" PreferredPasswordLength="10" MinimumNumericCharacters="2" RequiresUpperAndLowerCaseCharacters="True" MinimumLowerCaseCharacters="2" MinimumUpperCaseCharacters="2" MinimumSymbolCharacters="2" OnClientPasswordStrengthCalculating="" TextStrengthDescriptions="Very Weak;Weak;Medium;Strong;Very Strong" TextStrengthDescriptionStyles="riStrengthBarL0;riStrengthBarL1;riStrengthBarL2;riStrengthBarL3;riStrengthBarL4;riStrengthBarL5;" IndicatorElementBaseStyle="riStrengthBar" IndicatorElementID=""></PasswordStrengthSettings>
                                    </telerik:RadTextBox>
                                    <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="20%"
                                        style="z-index: 1; left: 80%; top: 20%; position: relative">
                                    </telerik:RadComboBox>
                                    <telerik:RadListBox ID="RadListBox1" runat="server" AllowDelete="True"
                                        style="left: 90%; top: 30%; position: relative; height: 69%; width: 30%;">
                                        <ButtonSettings TransferButtons="All"></ButtonSettings>
                                        <Items>
                                            <telerik:RadListBoxItem runat="server" />
                                        </Items>
                                        <Localization Delete="Remover" />
                                    </telerik:RadListBox>
                                 </div>
                                </ItemTemplate>
                            </telerik:RadPanelItem>
                        </Items>            
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Ler Mensagem">
                        <Items>
                            <telerik:RadPanelItem Value="ler" runat="server">
                                <ItemTemplate>
                                      
                                </ItemTemplate>
                            </telerik:RadPanelItem>
                        </Items>        
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem runat="server" Text="Lista de Mensagens" Selected="True" Expanded="True">
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelBar>
                                  
        </div>
FEST
Top achievements
Rank 1
 answered on 29 Jul 2011
2 answers
111 views
When I bring up the advanced edit/insert form the times range from 8am to 5pm, but my scheduler control's WorkDayStartTime and WorkDayEndTime as set to 5am and 7pm.  How do I get the advanced form to use the same time ranges as my WorkDay time range?
Plamen
Telerik team
 answered on 29 Jul 2011
3 answers
143 views
Hi,

      I have radtreeview and radgrid in my page.
     
      My problems are:
     1. I am binding radtreeview dynamically from database, Initially after binding radtreeview expand is not working. After clicking on node   radtreeview expand working fine.

      2. When i clicking on node it's color will be changed to light blue color, how can i remove this color from node. 

below is the screen shot of my issues. Thanks in advance.


Thanks,
Nagendra.
Plamen
Telerik team
 answered on 29 Jul 2011
2 answers
102 views
Hi!! I have a issue)))  I have a grid and EditFormSettings! In EditFormSettings i have a grid too))) in second grid i have button to click on that i have i radwindow! and i want to rebind this grid) by cliking the button on radwindow)) how i can do this?help please))) 
Timyr
Top achievements
Rank 1
 answered on 29 Jul 2011
1 answer
98 views

Hello,

I have two problems using the RadComboBox control.
1. I'm using the radgrid control that handles the insert, update and delete operations (using user control).
The user control has a radcombobox control that Displays two columns: color and value.

In normal situation where no validation controls are exist in the user control, the radComboBox control displays as it should be (Please view the attached screenshot).
If I add validation group to the user control then the error occures.
Please follow the steps below in order to show you the problem.
1) Click add new record.
2) Click on the radcombobox control (The result is shown in the attached screenshot1).
3) click "Add", then the validation error messages must appear.(dont fill in the Name field)
4) Click on the radcombobox control (The result is shown in the attached screenshot1 - No color appear).

2. As you can see there is a compare validator for the radcombobox (No "Select Color" item is exist).
How can I verify that the user select one color from the list (No selection must show an error message).

Here is the usercontrol content:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SubUserControl.ascx.cs" Inherits="IsraelOnTheMap.SecureSiteManagenment_Pages_SecureSQLServer_Ctgrs_SubUserControl" %>
 
<link rel="stylesheet" type="text/css" href="../../../../Common/Controls/RadEditor/RTLRadEditorStyle/Editor_RTL.css" />
<link rel="stylesheet" type="text/css" href="../../../Design/Style/SecureManagenmentStyle.css" />
 
<asp:Panel ID="SubPanel" runat="server" style="margin:10px;">
    <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none"
        style="BORDER-COLLAPSE: collapse">
        <tr id="LastVisitDateTr" align="<%$ Resources:MngResource, ContentFloat %>" runat="server">
            <td colspan="2">
                <asp:Panel ID="LastModifyPanel" runat="server" HorizontalAlign="<%$ Resources:MngResource, NoContentFloat %>" Visible='<%# ((bool)DataBinder.Eval(Container, "OwnerTableView.IsItemInserted")) ? false : true %>' Width="100%">
                    <asp:Label ID="LastModifyByTextLabel" runat="server" Visible="false" Font-Bold="true" Text="<%$ Resources:MngResource, LastModifyBy %>" ></asp:Label>
                    <asp:Label ID="LastModifyByIDLabel" runat="server" Visible="false" Text='<%#  DataBinder.Eval( Container, "DataItem.UserName" ) %>'></asp:Label>
                    <asp:Label ID="LastModifyDateTextLabel" runat="server" Font-Bold="true" Text="<%$ Resources:MngResource, LastModifyDate %>" ></asp:Label>
                    <asp:Label ID="LastModifyDateLabel" runat="server" Text='<%#  DataBinder.Eval( Container, "DataItem.LastModifyDate" ) %>'></asp:Label>
                </asp:Panel>
            </td>
        </tr>
        <tr id="DataFieldsTr" align="<%$ Resources:MngResource, ContentFloat %>" runat="server">
        <td>
            <table id="Table3" cellspacing="1" cellpadding="1" width="100%" border="0">
                <tr>
                    <td></td>
                    <td></td>
                </tr>
                <tr runat="server" Visible='<%# ((bool)DataBinder.Eval(Container, "OwnerTableView.IsItemInserted")) ? false : true %>'>
                    <td>
                        <asp:Label ID="CtgryIDLabel" runat="server" Text="<%$ Resources:MngResource, PagesSecureSqlServerCtgrsRadGridUserControlCtgryIDLabel %>"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="CtgryIDDataLabel" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.CtgryID" ) %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="CtgryNameLabel" runat="server" Text="<%$ Resources:MngResource, PagesSecureSqlServerCtgrsRadGridUserControlCtgryNameLabel %>"></asp:Label>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="CtgryNameDataRadTextBox" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.CtgryName" ) %>' Width="201px" ValidationGroup="CtgrsMngValidationGroup">
                        </telerik:RadTextBox>
                        <asp:RequiredFieldValidator ID="CtgryNameRequiredFieldValidator" runat="server"
                                    ControlToValidate="CtgryNameDataRadTextBox"
                                    SkinID="NormalRequiredFieldValidator"
                                    ErrorMessage="<%$ Resources:MngResource, PagesSecureSqlServerCtgrsRadGridUserControlCtgryNameRequiredFieldValidatorErrorMessage %>"
                                    ValidationGroup="CtgrsMngValidationGroup" ></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="CtgryColrLabel" runat="server" Text="<%$ Resources:MngResource, PagesSecureSqlServerCtgrsRadGridUserControlCtgryColrLabel %>"></asp:Label>
                    </td>
                    <td>
                        <asp:XmlDataSource ID="CtgrsXmlDataSource" runat="server" DataFile="~/Pages/Design/xml/Ctgrs.xml" >
                        </asp:XmlDataSource>
                        <telerik:RadComboBox ID="CtgryColrRadComboBox" runat="server" DataSourceID="CtgrsXmlDataSource"
                            DataValueField="Value" DataTextField="Text" SelectedValue='<%# DataBinder.Eval( Container, "DataItem.CtgryColr" ) %>' HighlightTemplatedItems="true"
                            AllowCustomText="true" Width="205px" style="z-index:10000;" ValidationGroup="CtgrsMngValidationGroup">
                            <ItemTemplate>
                                 <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                   <tr>
                                     <td style="width:20%;">
                                         <asp:Panel ID="Panel1" BorderWidth="1px" Height="12px" Width="12px" BackColor='<%# System.Drawing.Color.FromName("#" + Eval("Value").ToString()) %>' runat="server">
                                         </asp:Panel>
                                     </td>
                                     <td style="width:80%;">
                                         <asp:Label ID="Label2" runat="server" Text='<%# "#" + Eval("Value").ToString() %>'></asp:Label>
                                     </td>
                                   </tr>
                                 </table>
                            </ItemTemplate>
                        </telerik:RadComboBox>
                        <asp:CompareValidator ID="CtgryColrRequiredFirstNameValidator" runat="server"
                                    ControlToValidate="CtgryColrRadComboBox" Type="String" Operator="NotEqual"
                                    SkinID="NormalRequiredFieldValidator" ValueToCompare=" "
                                    ErrorMessage="<%$ Resources:MngResource, PagesSecureSqlServerCtgrsRadGridUserControlCtgryColrRequiredFirstNameValidatorErrorMessage %>"
                                    ValidationGroup="CtgrsMngValidationGroup" ></asp:CompareValidator>
                    </td>
                </tr>
             </table>
           </td>
       </tr>
       <tr>
            <td id="Td1" align="<%$ Resources:MngResource, NoContentFloat %>" runat="server" colspan="2">
                <asp:button id="btnUpdate" text="<%$ Resources:GeneralTelerikResource, TelerikRadGridEditFormUpdateButtonText %>" runat="server" CommandName="Update" Visible='<%# !(DataBinder.Eval( Container, "DataItem") is Telerik.Web.UI.GridInsertionObject) %>' ValidationGroup="CtgrsMngValidationGroup"></asp:button>
                <asp:button id="btnInsert" text="<%$ Resources:GeneralTelerikResource, TelerikRadGridEditFormInsertButtonText %>" runat="server" CommandName="PerformInsert" Visible='<%# DataBinder.Eval( Container, "DataItem") is Telerik.Web.UI.GridInsertionObject %>' ValidationGroup="CtgrsMngValidationGroup"></asp:button>
                  
                <asp:button id="btnCancel" text="<%$ Resources:GeneralTelerikResource, TelerikRadGridEditFormCancelButtonText %>" runat="server" causesvalidation="False" commandname="Cancel"></asp:button>
            </td>
        </tr>
   </table>
</asp:Panel>

Please, I need your help.
It is very appreciated to send me the modified code.

Regards,
Bader

Dimitar Terziev
Telerik team
 answered on 29 Jul 2011
1 answer
53 views
I need to write in Bangali language besides the default english language inside the Radeeditor. I have a javascript function which captures the keystrokes and converts those into Bangali(Unicode) equivalent. The function takes a textarea id and transforms the keystrokes. Since radeditor uses iframe and not textarea how to achieve this?
Dobromir
Telerik team
 answered on 29 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?