Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
332 views
I am having trouble controlling a radtextbox. I have a radcombobox(ddlMaritalStatus) and a radtextbox(txtSpoueName) on my page. What I would like is that when a user selects "Single" from ddlMaritalStatus then txtSpouseName becomes disabled. My problem is that if a user selects "Married" and starts to type in txtSpouseName but then changes ddlMaritalStatus to "Single" the text is still in txtSpouseName. So how do I make it so that if user selects "Single" then txtSpouseName becomes disabled and any text is erased and when user selects "Married" txtSpouseName becomes enabled again?

<p>
<telerik:RadComboBox ID="ddlMaritalStatus" runat="server" EmptyMessage="--Select--" OnClientSelectedIndexChanged="DisableBox" TabIndex="15" AutoPostBack="false"></telerik:RadComboBox>
​<script type="text/javascript">

function DisableBox(sender, args) {
    var TextBox = $find("<%=txtSpouseName.ClientID %>");
    if (sender.get_selectedItem().get_value() == "Single") {
         document.getElementById(sender.get_id().replace("ddlMaritalStatus", "txtSpouseName")).value = "";
         //document.getElementById("txtSpouseName").disabled=true;
         document.getElementById("txtSpouseName").setAttribute("Enabled", "False");
     }   
     else {
         document.getElementById(sender.get_id().replace("ddlMaritalStatus", "txtSpouseName")).value = "";
         //document.getElementById("txtSpouseName").disabled = false;
         document.getElementById("txtSpouseName").
     }
}

</script>
<asp:RequiredFieldValidator ID="MaritalStatusValidator" runat="server" ErrorMessage="Please Select" ControlToValidate="ddlMaritalStatus"></asp:RequiredFieldValidator>
</p>
<p>
<telerik:RadTextBox ID="txtSpouseName" runat="server" Enabled="false" AutoPostBack="false" TabIndex="16"></telerik:RadTextBox>
<asp:RegularExpressionValidator ID="SpouseNameValidator" runat="server" ErrorMessage="First (Initial) Last" ValidationExpression="[A-Z][a-z]+ ?[A-Z]? ([A-Z][a-z]?')?([A-Z][a-z]+?-)?[A-Z][a-z]+" ControlToValidate="txtSpouseName"></asp:RegularExpressionValidator>
</p>



My script is not working
Jesse
Top achievements
Rank 1
 answered on 25 Jul 2014
4 answers
124 views
We are using Telerik's Grid in ASP.NET to create a form where users can view and edit data. The filter functionality does not appear to be working; a user can enter data in a filter field and click on the filter icon, but when the menu with the filter options pops up, the user cannot click on any of the filter options. This only happens in IE 11.

We are using the 2013.3.1324.40 release of Telerik.Web.UI. Because some components did not function properly in IE 11, we have specified x-ua-compatible as "IE=9,10" and enabled UseLegacyBrowserCaps. I suspect that updating to the latest version of Telerik and switching to 'edge' instead of specifying rollback behavior to IE 9 and 10 will resolve this.

Can you confirm that the filters work properly in IE 11 when running in Edge mode?
Konstantin Dikov
Telerik team
 answered on 25 Jul 2014
2 answers
145 views
Dear Support,

after updatin to the newest ui an error is raising



In this case the property this._functionality is undefined.

Whats wrong?

Kinde regards,
Christian 





Dobromir
Telerik team
 answered on 25 Jul 2014
4 answers
152 views
Hi  I have a user control that I am trying to populate within a nested Gridview  detail view,   the code below shows the casesOrdered value  but not in the user control uc1:BrandVisit  which accepts inputs as in casesMerchandised  How can I bind values to this user control?   Any ideas would be much appreciated


<asp:DetailsView ID="DetailsView1" AllowPaging="true" runat="server" GridLines="None" Width="100%" DataSourceID="
<asp:DetailsView ID="DetailsView1" AllowPaging="true" runat="server" GridLines="None" Width="100%" DataSourceID="SqlDataSourceVimto" Font-Italic="true" AutoGenerateRows="false">
               <Fields>
                   <asp:TemplateField><ItemTemplate>
                        Cases are  <%# Convert.ToDecimal(Eval("casesOrdered")) %>
                      
                          <uc1:brandVisit  runat="server" ID="brandVisit"   casesOrdered='<%# Bind("casesOrdered") %>'  OnDataBinding="brandVisit_DataBinding" casesMerchandised="12"   />
 
                   </ItemTemplate></asp:TemplateField>
               </Fields>
           </asp:DetailsView>
"
Font-Italic="true" AutoGenerateRows="false">
               <Fields>
                   <asp:TemplateField><ItemTemplate>
                        Cases are  <%# Convert.ToDecimal(Eval("casesOrdered")) %>
                      
                          <uc1:brandVisit  runat="server" ID="brandVisit"   casesOrdered='<%# Bind("casesOrdered") %>'  OnDataBinding="brandVisit_DataBinding" casesMerchandised="12"   />
 
                   </ItemTemplate></asp:TemplateField>
               </Fields>
           </asp:DetailsView>

 

The BradVisit User contro is like below
public decimal casesOrdered
  {
      get
      {
          return decimal.Parse(tbCasesOrdered.Text);
      }
      set{
          tbCasesOrdered.Text = value.ToString();
      }
    }




Gareth
Top achievements
Rank 1
 answered on 25 Jul 2014
6 answers
259 views
The issue is when I click on the series in the chart, OnClientSeriesClicked event is not firing. 
for the same type of chart OnClientSeriesHovered event is working fine.Please do the needful whether this type chart is not supports with OnClientSeriesClicked  event or Is there anything wrong with my code.?If not supports with OnClientSeriesClicked  event let me know the other alternative way for click event.

attached Output.

 <telerik:RadHtmlChart runat="server" ID="TemperatureRadHtmlChart" Width="900" Height="350"
                OnClientSeriesClicked="OnClientSeriesClicked" Transitions="true">
                <PlotArea>
                    <Appearance>
                        <FillStyle BackgroundColor="White"></FillStyle>
                    </Appearance>
                    <Series>
                        <telerik:CandlestickSeries Name="XAxis" DataCloseField="MaxTemp" DataHighField="MaxTemp"
                            DataOpenField="MinTemp" DataLowField="MinTemp">
                            <Appearance>
                                <FillStyle BackgroundColor="LimeGreen" />
                            </Appearance>
                            <TooltipsAppearance DataFormatString="{0}" Color="Black">
                                <ClientTemplate>
                                 #=dataItem.XAxis#:#=dataItem.MinTemp# to #=dataItem.MaxTemp#
                                </ClientTemplate>
                            </TooltipsAppearance>
                        </telerik:CandlestickSeries>
                    </Series>
                    <XAxis Step="100" MajorTickType="Outside" MinorTickType="Outside" Reversed="false"
                        Color="Black">
                        <LabelsAppearance RotationAngle="0">
                        </LabelsAppearance>
                        <MajorGridLines Color="White" Width="1"></MajorGridLines>
                        <MinorGridLines Color="White" Width="1"></MinorGridLines>
                        <TitleAppearance Position="Center" RotationAngle="0">
                        </TitleAppearance>
                    </XAxis>
                    <YAxis Color="Black" MajorTickSize="1" MajorTickType="Outside" MinorTickSize="1"
                        MinorTickType="Outside" Reversed="false">
                        <MajorGridLines Color="LightGray" Width="1"></MajorGridLines>
                        <MinorGridLines Color="LightGray" Width="1"></MinorGridLines>
                        <TitleAppearance>
                        </TitleAppearance>
                    </YAxis>
                </PlotArea>
                <Legend>
                    <Appearance Visible="false" />
                </Legend>
            </telerik:RadHtmlChart> 

<script type="text/javascript" language="javascript">
        function OnClientSeriesClicked(sender, args) {
            debugger;
            var s = args.get_seriesName() + ',' + args.get_category();
            //var s = args.get_category() + ',' + args.get_seriesName();
            $find("<%= RadAjaxManager.ClientID %>").ajaxRequest(s);
        }







Stamo Gochev
Telerik team
 answered on 25 Jul 2014
1 answer
319 views
Hello,

I am working on session handling for my project.

I have a parent aspx page which holds RadGrid. On RadGrid row click, new RadWindow opens new aspx page using javascript function - 

            function RowDblClick(sender, eventArgs) {
                var wnd = window.radopen("url");
                wnd.setSize(960, 700);
                wnd.Center();
            }

To get server know that session has expired, meta information header is used in each Page_Load event which refreshes page after 1 second of session timeout - 
         
                 Response.AddHeader("Refresh",Convert.ToString((Session.Timeout * 60) + 1));

After refresh if there is new session, then page is redirected to Login page.

This woks fine until there is timeout when RadWindow is open on parent page. If Radwindow is open, after refresh due to session timeout it just close down itself and browser displays parent aspx page with RadGrid.
 
The problem is how and where server can know that RadWindow is closed (which event) and as RadWindow is closed server do not have any handle to it so how can parent aspx page redirected to login page. In short, how server can first close RadWindow on parent aspx page and then redirect parent aspx page to login page.

Thanks! 

Princy
Top achievements
Rank 2
 answered on 25 Jul 2014
1 answer
116 views
I have a scheduler which use web service to get the data. I need to use the formcreated event in the server side to select a value to the resource combo box. But the event is never fired. What is the problem? I have changed many things and nothing works.
Boyan Dimitrov
Telerik team
 answered on 25 Jul 2014
1 answer
229 views
Hi,

I'm having trouble getting the data from EditForm when I PerformInsert from the CommandItemTemplate, please help.

<telerik:RadGrid ID="RadGrid1" runat="server"

AllowPaging="false" AllowSorting="false" AutoGenerateColumns="false"

AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"

ShowHeader="false"

OnItemCommand="RadGrid1_ItemCommand"

OnPreRender="RadGrid1_PreRender"

OnNeedDataSource="RadGrid1_NeedDataSource"

OnInsertCommand="RadGrid1_InsertCommand">

<MasterTableView DataKeyNames="PersonID" Width="50%" CommandItemDisplay="Bottom">

<CommandItemTemplate>

<telerik:RadButton ID="RadButtonInsert" runat="server" Text="Add" CommandName="PerformInsert">

<Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="3"></Icon>

</telerik:RadButton>

</CommandItemTemplate>

<CommandItemSettings />

<NoRecordsTemplate></NoRecordsTemplate>

<EditFormSettings>

<PopUpSettings Modal="true" />

</EditFormSettings>

<Columns>

<telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">

</telerik:GridEditCommandColumn>

<telerik:GridBoundColumn UniqueName="FirstName" HeaderText="FirstName" DataField="FirstName">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="LastName" HeaderText="LastName" DataField="LastName">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="Telephone" HeaderText="Telephone" DataField="Telephone">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="Email" HeaderText="Email" DataField="Email">

</telerik:GridBoundColumn>

<telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />

</Columns>

<EditFormSettings EditFormType="Template">

<FormTemplate>

* Person Name (Salutation, First, Middle, Last and Suffix):<br />

<telerik:RadComboBox ID="RadComboBox1" runat="server"

EnableLoadOnDemand="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true"

OnItemsRequested="DropDownListCertHolderSalutation_ItemsRequested">

</telerik:RadComboBox>

<telerik:RadTextBox Width="250px" ID="TextBoxAttorneyFirstName" Text='<%# Bind( "FirstName") %>' runat="server" TabIndex="8">

</telerik:RadTextBox>

<telerik:RadTextBox Width="25px" ID="TextBoxAttorneyMiddleInitial" Text='<%# Bind( "MiddleInitial") %>' runat="server">

</telerik:RadTextBox>

<telerik:RadTextBox Width="250px" ID="TextBoxAttorneyLastName" Text='<%# Bind( "LastName") %>' runat="server">

</telerik:RadTextBox>

<telerik:RadComboBox ID="RadComboBox2" runat="server"

EnableLoadOnDemand="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true"

OnItemsRequested="DropDownListCertHolderSuffix_ItemsRequested">

</telerik:RadComboBox>

<br />

Address:<br />

<telerik:RadTextBox Width="500px" ID="TextBoxAttorneyAddress1" Text='<%# Bind( "Address1") %>' runat="server">

</telerik:RadTextBox>

<br />

<telerik:RadTextBox Width="500px" ID="TextBoxAttorneyAddress2" Text='<%# Bind( "Address2") %>' runat="server">

</telerik:RadTextBox>

<br />

Country:

<telerik:RadComboBox ID="RadComboBox3" runat="server"

EnableLoadOnDemand="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true" AutoPostBack="true"

OnItemsRequested="DropDownListCertHolderCountry_ItemsRequested"

OnSelectedIndexChanged="DropDownListCertHolderCountry_SelectedIndexChanged">

</telerik:RadComboBox>

&nbsp State:

<telerik:RadComboBox ID="RadComboBox4" runat="server"

EnableLoadOnDemand="True" ShowMoreResultsBox="true" EnableVirtualScrolling="true"

OnItemsRequested="DropDownListCertHolderState_ItemsRequested">

</telerik:RadComboBox>

<telerik:RadTextBox ID="RadTextBox6" runat="server" Width="200px" Visible="false"></telerik:RadTextBox>

&nbsp City:

<telerik:RadTextBox ID="RadTextBox7" runat="server" Width="250px"></telerik:RadTextBox>

&nbsp Zip Code:

<telerik:RadMaskedTextBox Width="50px" ID="RadMaskedTextBox1" runat="server" Mask="#####" TextMode="SingleLine">

</telerik:RadMaskedTextBox>

<br />

Telephone:

<telerik:RadMaskedTextBox Width="125px" ID="RadMaskedTextBox2" runat="server" Mask="(###) ###-####-####" TextMode="SingleLine">

</telerik:RadMaskedTextBox>

&nbsp Fax:

<telerik:RadMaskedTextBox Width="125px" ID="RadMaskedTextBox3" runat="server" Mask="(###) ###-####-####" TextMode="SingleLine">

</telerik:RadMaskedTextBox>

&nbsp

Email Address:

<telerik:RadTextBox ID="RadTextBox8" runat="server" Width="250px"></telerik:RadTextBox>

<br />

</FormTemplate>

</EditFormSettings>

</MasterTableView>

</telerik:RadGrid

 

 

>



protected void RadGrid1_PreRender(object sender, EventArgs e)

 

 

{

 

if (!Page.IsPostBack)

 

 

{

 

RadGrid1.MasterTableView.IsItemInserted = true;//so I can insert after load

 

 

RadGrid1.Rebind();

}

}

 

protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)

 

 

{

 

if (e.CommandName == RadGrid.PerformInsertCommandName)

 

 

{

 

GridEditFormInsertItem f = (GridEditFormInsertItem)RadGrid1.MasterTableView.GetInsertItem();

Person p = new Person();

p.FirstName = (f.FindControl("FirstName") as TextBox).Text; //?? this control doesn't exist

 

 

}

}

 

protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)

 

 

{

 

GridEditFormInsertItem item = e.Item as GridEditFormInsertItem; //?? this is null

 

 

}

 

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)

 

 

{

 

RadGrid1.DataSource = Conselors;//loads a List<Person>

 

 

}

 

 

 

Shinu
Top achievements
Rank 2
 answered on 25 Jul 2014
1 answer
457 views
I need to be able to open a modal and bind a RadListBox within the modal at the point in time when the modal opens. Then the user will make selections from the RadListBox and click a button in the modal which needs to cause a partial postback to update a RadComboBox on the main page. I'm struggling to find the right way to achieve this. So far I have a RadWindow control which contains the RadListBox and the button and I found a code example for binding before opening a modal. 

<telerik:RadWindow ID="rwModal" runat="server" DestroyOnClose="False" Skin="Telerik"
    Modal="True" Width="450" Height="550" Behaviors="None">
    <ContentTemplate>
            <telerik:RadListBox ID="rlb1" runat="server" Width="200" Height="400">
            </telerik:RadListBox>
            <asp:LinkButton ID="lnkOK" runat="server" Text="OK" />
            <asp:LinkButton ID="lnkCancel" runat="server" Text="Cancel" />
    </ContentTemplate>
</telerik:RadWindow>

Private Sub lnkShowModal_Click(sender As Object, e As System.EventArgs) Handles lnkShowModal.Click
      rlb1.DataSource = cmbList.Items
      rlb1.DataTextField = "Text"
      rlb1.DataValueField = "Value"
      rlb1.DataBind()
   
      Dim script As String = "function f(){$find(""" + rwModal.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
      ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)
  End Sub

Private Sub lnkOK_Click(sender As Object, e As System.EventArgs) Handles lnkOK.Click
    cmbDeptDCVL.Visible = False
End Sub

What is the best way to do a partial postback on lnkOK_Click? I have a RadAjaxManagerProxy on the page already.
Shinu
Top achievements
Rank 2
 answered on 25 Jul 2014
3 answers
252 views
Hi there,

I have added a checkbox on my page which expands & collapses the inner grids. However, I cannot use the Ajax Loading Panel with its on checked changed server-side event.
What is it wrong here ?
ASPX:
01.        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
02.        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
03.            <AjaxSettings>
04.                <telerik:AjaxSetting AjaxControlID="RadGrid1">
05.                    <UpdatedControls>
06.                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
07.                    </UpdatedControls>
08.                </telerik:AjaxSetting>
09.                <telerik:AjaxSetting AjaxControlID="RadGrid2">
10.                    <UpdatedControls>
11.                        <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
12.                    </UpdatedControls>
13.                </telerik:AjaxSetting>
14.                <telerik:AjaxSetting AjaxControlID="chkSalesReportExpandAll">
15.                    <UpdatedControls>
16.                        <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
17.                    </UpdatedControls>
18.                </telerik:AjaxSetting>
19.            </AjaxSettings>
20.            <%--<ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />--%>
21.        </telerik:RadAjaxManager>
22.        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" Skin="Default" />
23.        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
24.            <script type="text/javascript">
25.                var hdfSelectedTab = $('#<%=hdfSelectedTab.ClientID%>');
26.            </script>
27.        </telerik:RadCodeBlock>
28. 
29.                    <asp:CheckBox ID="chkSalesReportExpandAll" AutoPostBack="true" Text="Expand All"
30.                        OnCheckedChanged="chkSalesReportExpandAll_CheckedChanged" runat="server" Visible="false"></asp:CheckBox>
31.                </div>
32.                <br />
33.                <div id="pnlSalesReport" runat="server" visible="false">
34.                    <asp:ImageButton ID="salesReportHTML" runat="server" OnClick="salesReportHTML_Click" AlternateText="Html" ImageUrl="images/file-extension-xls-html-icon.png"
35.                        CssClass="pdfButton"></asp:ImageButton>
36.                    <asp:ImageButton ID="salesReportExcelML" runat="server" OnClick="salesReportHTML_Click" AlternateText="ExcelML" ImageUrl="images/file-extension-xls-icon.png"
37.                        CssClass="pdfButton"></asp:ImageButton>
38.                    <asp:ImageButton ID="salesReportBiff" runat="server" OnClick="salesReportHTML_Click" AlternateText="Biff" ImageUrl="images/file-extension-xls-biff-icon.png"
39.                        CssClass="pdfButton"></asp:ImageButton>
40.                    <asp:ImageButton ID="salesReportPDF" runat="server" OnClick="salesReportPDF_Click" ImageUrl="images/file-extension-pdf-icon.png"
41.                        CssClass="pdfButton"></asp:ImageButton>
42.                    <br />
43.                    <telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid2" EnableViewState="true" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" runat="server" ShowFooter="true"
44.                        OnItemCommand="RadGrid2_ItemCommand" OnItemCreated="RadGrid2_ItemCreated" EnableLinqExpressions="true" HtmlEncode="true" PageSize="50" Height="100%" OnNeedDataSource="RadGrid2_NeedDataSource"
45.                        ShowGroupPanel="True" CellSpacing="-1" GridLines="Both" Skin="Office2010Silver" Width="100%">
46.                        <PagerStyle Mode="NextPrevAndNumeric" />
47.                        <GroupingSettings CaseSensitive="false" />
48.                        <ClientSettings AllowKeyboardNavigation="true">
49.                        </ClientSettings>
50.                        <ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true">
51.                            <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm"
52.                                BorderStyle="Medium" BorderColor="#666666" PaperSize="A4">
53.                            </Pdf>
54.                        </ExportSettings>
55.........
56.........

Thank you
Shinu
Top achievements
Rank 2
 answered on 25 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?