Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
288 views
Hello.
I have a MasterPage setup in a Web Application.
Based on different button clicks i load dynamically different usercontrols in a contentplaceholder.

ContentPlaceHolder cph = this.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
      UserControl uc = this.LoadControl("~/UserControls/" + strName + ".ascx") as UserControl;
 
      if ((cph != null) && (uc != null))
      {
          uc.ID = strName;
          cph.Controls.Clear();
          cph.Controls.Add(uc);
          IsControlAdded = true;
          ViewState[IDS_USERCONTROL] = strName;
      }

The problem is that i need in Site.Master to use some js code that exists in a dynamically loaded usercontrol.
That seems to be no problem for the first loaded usercontrol because the usercontrols html is included in the master page html.
The problem arrises when i dynimically load the second usercontrol i find out that the html and js from the first usercontrol loaded persists in the master page and the second usercontrol's js and html is not loaded.

If i add EnableAJAX="false" to the radajaxmanager it solves my problem .. but then again .. that beats the purpose of using ajaxmanager.
 
switch (index) {
 case 0: //Person
     var arr = GetSelectedPerson();                            
     args.set_cancel(true);
     break;
 case 1: //Company
     break;
 case 2: //Group
     var arr = GetSelectedGroups();
    break;

This is a code snipplet from Site.Master
GetSelectedPerson and GetSelectedGroups are two js methods that exist in different usercontrols.

Maria Ilieva
Telerik team
 answered on 27 Jun 2012
9 answers
726 views
Is there a property for the RadNumericTextBox equivalent to the "Validation-IsRequired" property of the RadInputManager control?
Maria Ilieva
Telerik team
 answered on 27 Jun 2012
3 answers
283 views
Hi,

I have country and city column in the radgrid and I have defined a template filters using radcombobox for both the columns. I am able to filter on both columns.

The only problem I have is when removing filtering.

Say I have filtered on both Country and city column and then I select All in the Country Filter column. 
In the country combo selectedindexchanged event I am clearing the filtering using the following command

filterItem.FireCommandEvent("Filter", new Pair("NoFilter", "Country")); 

The problem is that the filtering on the city column is still active. So i modified the above code to this

filterItem.FireCommandEvent("Filter", new Pair("NoFilter", "Country")); 
filterItem.FireCommandEvent("Filter", new Pair("NoFilter", "City")); 

THe above code does not work. The FireCommandEvent works only for the first line, not for the second. I tried switching the statement order.  Is it possible to remove filtering on multiple columns by calling FireCommandEvent multiple times.

Thanks
Pavlina
Telerik team
 answered on 27 Jun 2012
3 answers
216 views
I'm using an image with a hyperlink grid column but I am unable to get the image to vertically align in the middle. It almost appears like the grid is placing the image in the column an an unbreakable space ( & nbsp ;) causing the image to be forced to the top.

Any thoughts?
Eyup
Telerik team
 answered on 27 Jun 2012
10 answers
381 views
Hello Everyone,

I have two questions about Radgrid that I never understood completely. I'm using the new telerik 2011.3.1305.40. ASP.NET AJAX.
I Send a download Link with a simple example to illustrate my doubts. http://www.omnilab.com.br/documentos/ReadOnlyFields.rar
In the example I have one table with 4 fields. One of them is the primary key and identity field.

When I run the example, all happens fine, I can Edit and Update the table, however:
  1. When I make the field "id_movie" readonly, the table no longer updates. Why this happens? How can I solve this?
  2. If I change the type of field "control" to bit (to enable checkbox), the table no longer updates. Why this happens? How can I solve this?

I appreciate anyone to clarify those doubts to me.

Regards,
Marcio Nascimento

Andrew
Top achievements
Rank 1
Veteran
Iron
 answered on 27 Jun 2012
5 answers
340 views
I'm trying to build something like a "newsletter manager" that allows the user to compose an html formatted message and then send it to mailing lists.
In a real scenario, the user would insert Images and/or other "contents" (something that's not just typed text) selecting it from its local hard drive.
Onche the content file has been selected, and the user has choosen some of its properties (i.e. height/width for an image) I would like to process this file, maybe resize/compact it, then upload to a specific website folder, and then have the url to that file inserted in the editor content.

I hoped that this was what the RadEditor ImageDialog and similar do, but it doesn't seems so.
I'm I wrong ar I'm I missing something ?

What is the preferred tecnique to achieve that goal ?

thx
Ubaldo
Rumen
Telerik team
 answered on 27 Jun 2012
0 answers
430 views
Need help here. This grid has 2 records being displayed. If I edit the first record everything works fine. If I edit the second record I get this debug message:

This only happens if I have ListDataMember="ReportName"

HttpException was unhandled by user code
DataBinding: 'System.String' does not contain a property with the name 'ReportName'

here is the item databound sub, Getting the error on ReportNameddList.Databind()
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid1.ItemDataBound
    If (TypeOf e.Item Is GridEditableItem AndAlso CType(e.Item, GridEditableItem).IsInEditMode) Then
        Dim GridRow As GridEditableItem = e.Item
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        Dim editMan As GridEditManager = editedItem.EditManager
 
 
        ' this covers the report format field priming
        Dim editor As GridDropDownListColumnEditor = CType(editMan.GetColumnEditor("ddReportFormat"), GridDropDownListColumnEditor)
 
        Dim ReportFormatddList As DropDownList = editor.DropDownListControl
        ReportFormatddList.Items.Insert(0, New ListItem("Excel", "Excel"))
        ReportFormatddList.Items.Insert(1, New ListItem("PDF", "PDF"))
        ReportFormatddList.Items.Insert(2, New ListItem("HTML4.0", "HTML4.0"))
        ReportFormatddList.DataBind()
 
        'select the correct record
        Dim ReportFormatString As String = GridRow.GetDataKeyValue("ReportFormat").ToString()
        ReportFormatddList.Items.FindByValue(ReportFormatString).Selected = True
 
 
 
        'this covers the report name field priming
        editor = CType(editMan.GetColumnEditor("ddReportName"), GridDropDownListColumnEditor)
        Dim ReportNameddList As DropDownList = editor.DropDownListControl
        ReportNameddList.DataSource = (From r In DbContext.SubscriptionReportNames Select r.ReportName).ToList()
        ReportNameddList.DataBind()  '<-- this is the error line, but only when second row is being edited.

 
        'select the correct record
        Dim ReportNameString As String = GridRow.GetDataKeyValue("ReportName").ToString()
        ReportNameddList.Items.FindByValue(ReportNameString).Selected = True
 
 
 
    End If
End Sub

.aspx code
  <telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="False"
            AllowPaging="True" AllowSorting="True" CellSpacing="0"
        GridLines="None" ShowGroupPanel="True" Skin="Web20">
            <MasterTableView DataKeyNames="ReportFormat,ReportName,FranchiseSubscriptionEmailID" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" />
 
                    <telerik:GridBoundColumn DataField="FranchiseSubscriptionEmailID"
                        HeaderText="Record ID" ReadOnly="true"
                        ForceExtractValue="Always" ConvertEmptyStringToNull="true"
                        Visible="False" />
 
                    <telerik:GridBoundColumn DataField="FranchiseeID" HeaderText="Franchisee ID"
                        Visible="False" />
 
                <telerik:GridDropDownColumn DataSourceID="ReportNameddlist" ListTextField="ReportName"
                    ListValueField="ReportName" UniqueName="ddReportName" SortExpression="ReportName"
                    HeaderText="Report Name" DropDownControlType="DropDownList" ListDataMember="ReportName"
                        DataField="ReportName">
                </telerik:GridDropDownColumn>
 
                    <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="Email Address" />
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Franchisee Name" />
 
                <telerik:GridDropDownColumn DataSourceID="ReportFormatddlist" ListTextField="ReportFormat"
                    ListValueField="ReportFormat" UniqueName="ddReportFormat" SortExpression="ReportFormat"
                    HeaderText="Report Format" DropDownControlType="DropDownList"
                        DataField="ReportFormat" ListDataMember="ReportFormat">
                </telerik:GridDropDownColumn>
 
                    <telerik:GridButtonColumn ConfirmText="Delete this record?" ConfirmDialogType="RadWindow"
                       ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
 
                </Columns>
                <EditFormSettings>
                    <EditColumn ButtonType="ImageButton" />
                </EditFormSettings>
            </MasterTableView>
            <PagerStyle Mode="NextPrevAndNumeric" />
            <ClientSettings AllowDragToGroup="True">
                <ClientEvents OnRowDblClick="rowDblClick" />
            </ClientSettings>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
        </telerik:RadGrid>
justin
Top achievements
Rank 1
 asked on 27 Jun 2012
8 answers
306 views
Something changed re: RadNumericTextBoxes in the newest version of the Telerik Rad Ajax Controls (2012.2.607.40)

Our client-side/markup validators are all now broken on any currency validation as the "$" and the "," values are being passed thru instead of the raw value.

This change just happened with this new version of the Ajax controls and we have a lot of code that is now broken in production.

Need someone at Telerik to address this ASAP.

<telerik:RadNumericTextBox ID="rntbBudget" runat="server" CssClass="TextboxAnimated" Width="150px"
    Type="Currency" DataType="Decimal" DbValue='<%# Eval("fldBudget") %>' NumberFormat-DecimalDigits="2" />
<asp:RequiredFieldValidator ID="rfvBudget" runat="server" ControlToValidate="rntbBudget"
    ErrorMessage="Must enter a Budget amount!" Text="!" CssClass="errorMessage" />
<asp:CompareValidator ID="cvBudget" runat="server" ControlToValidate="rntbBudget" ValueToCompare="0.00"
    Operator="GreaterThan" Type="Currency" ErrorMessage="The Budget amount must be greater than $0.00!" Text="!" CssClass="errorMessage" />


The above code now generates a validation error when it never did before.

Jerry



**EDIT**

Below is a workaround, for now:
<telerik:RadNumericTextBox ID="rntbBudget" runat="server" CssClass="TextboxAnimated" Width="150px"
    Type="Number" DataType="Decimal" DbValue='<%# Eval("fldBudget") %>' NumberFormat-DecimalDigits="2" NumberFormat-GroupSeparator="" />
<asp:RequiredFieldValidator ID="rfvBudget" runat="server" ControlToValidate="rntbBudget"
    ErrorMessage="Must enter a Budget amount!" Text="!" CssClass="errorMessage" />
<asp:CompareValidator ID="cvBudget" runat="server" ControlToValidate="rntbBudget" ValueToCompare="0.00"
    Operator="GreaterThan" Type="Currency" ErrorMessage="The Budget amount must be greater than $0.00!" Text="!" CssClass="errorMessage" />

Notice the changes: The Type attribute on the RadNumericTextBox had to be changed from "Currency" to "Number" and the NumberFormat-GroupSeparator attributte had to be added but set to an empty string "".

This means a LOT of our production code now needs to be modified due to this underlying change in the RadNumericTextBox control.

Why did that change? There was no mention of it in the release notes either.
Jerry T.
Top achievements
Rank 1
 answered on 27 Jun 2012
1 answer
71 views
Which Rad control should I use for a CheckBox when I'm using ASP.NET Ajax?
Bozhidar
Telerik team
 answered on 27 Jun 2012
3 answers
357 views
Hi all how can I work with tabstrip inside update panel. I have designed as follows
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="radTabStripMultiPage.aspx.cs"
    Inherits="radTabStripMultiPage" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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>
    <link href="StyleSheet2.css" rel="stylesheet" type="text/css" />
    <link href="TabStrip.WebBlue.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="rad" runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadWindowManager ID="RadWindowManager2" runat="server" VisibleOnPageLoad="false">
            <Shortcuts>
                <telerik:WindowShortcut CommandName="CloseAll" Shortcut="Esc" />
            </Shortcuts>
        </telerik:RadWindowManager>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="Default"
            InitialBehavior="None">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Default" InitialBehaviors="None"
                    OpenerElementID="btn" Width="650" Height="480" VisibleOnPageLoad="false">
                    <ContentTemplate>
                        <telerik:RadComboBox ID="rdcmb" runat="server">
                            <Items>
                                <telerik:RadComboBoxItem Text="One" Value="One" />
                                <telerik:RadComboBoxItem Text="Two" Value="Two" />
                                <telerik:RadComboBoxItem Text="Three" Value="Three" />
                                <telerik:RadComboBoxItem Text="Four" Value="Four" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadTextBox ID="rdText" runat="server">
                        </telerik:RadTextBox>
                        <telerik:RadButton ID="radbtn" runat="server" Text="Save">
                        </telerik:RadButton>
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <telerik:RadTabStrip ID="rdtabEmployee" runat="server" MultiPageID="rdmpPersonal"
                    UnSelectChildren="True" Skin="WebBlue" EnableEmbeddedSkins="False" ClickSelectedTab="True"
                    SelectedIndex="0" OnTabClick="tabClick">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="Personal" PageViewID="rdpgPersonal">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Contact" PageViewID="rdpgContact">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Salary" PageViewID="RadPageView1">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Bank" PageViewID="RadPageView2">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Taxes" SelectedIndex="0">
                            <Tabs>
                                <telerik:RadTab runat="server" Text="Residence" PageViewID="rdpgResident">
                                </telerik:RadTab>
                                <telerik:RadTab runat="server" Text="Work" PageViewID="rdpgWork">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Demo">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Demo1">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Demo2">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Demo1">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>
                <telerik:RadMultiPage ID="rdmpPersonal" runat="server">
                    <telerik:RadPageView ID="rdpgPersonal" runat="server" Selected="true">
                        <telerik:RadPanelBar runat="server" ID="rdpnlPersonal" ExpandMode="FullExpandedItem"
                            Skin="Vista" EnableEmbeddedSkins="false" Width="550px">
                            <Items>
                                <telerik:RadPanelItem Expanded="true" Text="Employee Personal Information" runat="server"
                                    Selected="true">
                                    <Items>
                                        <telerik:RadPanelItem Value="AccountInformation" runat="server">
                                            <ItemTemplate>
                                                <label>
                                                    Demop
                                                </label>
                                                <telerik:RadButton ID="rdbtnwhAnother" Text="Add WithHolding" runat="server" ButtonType="LinkButton"
                                                    OnClick="rdbtnwhAnother_Click">
                                                </telerik:RadButton>
                                            </ItemTemplate>
                                        </telerik:RadPanelItem>
                                    </Items>
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelBar>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="rdpgContact" runat="server">
                        <label>
                            Demo Contact
                        </label>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView1" runat="server">
                        <label>
                            Salary Demo
                        </label>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView2" runat="server">
                        <label>
                            Demo Bank
                        </label>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="rdpgResident" runat="server">
                        <label>
                            Resident Demo
                        </label>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="rdpgWork" runat="server">
                        <label>
                            Work Demo
                        </label>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView3" runat="server">
                        <label>
                            Work Demo
                        </label>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView4" runat="server">
                        <label>
                            Work Demo
                        </label>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView5" runat="server">
                        <label>
                            Work Demo
                        </label>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView6" runat="server">
                        <label>
                            Work Demo
                        </label>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="RadPageView7" runat="server">
                        <label>
                            Work Demo
                        </label>
                    </telerik:RadPageView>
                </telerik:RadMultiPage>
            </ContentTemplate>
        </asp:UpdatePanel>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Width="16px">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rdbtnwhAnother">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rdmpPersonal">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rdtabEmployee" />
                        <telerik:AjaxUpdatedControl ControlID="rdmpPersonal" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rdtabEmployee">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rdtabEmployee" />
                        <telerik:AjaxUpdatedControl ControlID="rdmpPersonal" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    </div>
    </form>
</body>
</html>

This is my code


protected void tabClick(object sender, RadTabStripEventArgs e)
    {
        switch (e.Tab.Text)
        {
            case "Personal":
                break;
        }
        if (e.Tab.Text == "Taxes")
        {
            RadTab tab1 = rdtabEmployee.FindTabByText("Taxes");
            tab1.Selected = true;
            tab1.SelectedIndex = 0;
            RadPageView pv1 = rdmpPersonal.FindPageViewByID("rdpgResident");
            pv1.Selected = true;
        }
        if (e.Tab.Text == "Residence")
        {
            RadTab tab1 = rdtabEmployee.FindTabByText("Taxes");
            tab1.Selected = true;
            tab1.SelectedIndex = 0;
            RadPageView pv1 = rdmpPersonal.FindPageViewByID("rdpgResident");
            pv1.Selected = true;
        }
        if (e.Tab.Text == "Work")
        {
            RadTab tab1 = rdtabEmployee.FindTabByText("Taxes");
            tab1.Selected = true;
            tab1.SelectedIndex = 1;
            RadPageView pv1 = rdmpPersonal.FindPageViewByID("rdpgWork");
            pv1.Selected = true;
        }
    }

But on clicking the tab activating only one i.e If i select Tab 2 and then Tab3 tab3 is not getting selected can any one help
Dimitar Terziev
Telerik team
 answered on 27 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?