Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
123 views
Hey All,

I am running into a few issues when I try to use required field validators on the radnumerictext box. On the actual form that I was trying to develop I have several RadNumericTextBox controls that the user must at least touch in order for the form to be valid. To make it more convenient I have used JQuery (and tried straight javascript) to set the textbox's value to 0 if the user tabs out with out entering anything. The problem I am having is that the RequiredFieldValidator's do not seem to recognize that there is a number in the rad numeric text box unless I actually press 0. I have tried this with a regular asp.net text box and it works. It also works with the rad numeric text box in Firefox & Chrome. I have created a simplified asp .net page. The customAttribute="hiddenSection3" on the RadNumericTextBox and the hidden fields at the bottom are just there so the Utils.js doesn't throw an error. I have also tried it with out the customAttribute and the result is the same.

Thanks in advance


I have the following page: 
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="IETester.aspx.vb" Inherits="IETester" %>
 
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
 
<%@ 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>Untitled Page</title>
    <link type="text/css" rel="Stylesheet" href="css/chrome.css" />
    <script language="javascript" type="text/javascript" src="scripts/jquery-1.4.1.js"></script>
    <script language="javascript" type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script>
    <script language="javascript" type="text/javascript" src="scripts/jquery-1.4.1-vsdoc.js"></script>
    <script language="javascript" type="text/javascript" src="scripts/Utils.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
     
        <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server" customAttribute="hiddenSection3"  CssClass="numeric" NumberFormat-DecimalDigits="0">
        </telerik:RadNumericTextBox>
         
        <asp:Button ID="Button1" runat="server" Text="Button" />
         
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator" Display="Dynamic" ControlToValidate="RadNumericTextBox1"></asp:RequiredFieldValidator>
         
       <%-- <telerik:RadInputManager ID="RadInputManager1" runat="server">
             
            <telerik:NumericTextBoxSetting Type="Currency" BehaviorID="Setting2" Validation-IsRequired="true" EmptyMessage="Error" ErrorMessage="Error" Validation-ValidateOnEvent="All" >
                <TargetControls>
                    <telerik:TargetInput ControlID="RadNumericTextBox1" Enabled="true" />
                </TargetControls>
            </telerik:NumericTextBoxSetting>
           
        </telerik:RadInputManager>
        --%>
          <input type="hidden" id="hiddenIdentified" value="0" />
    <input type="hidden" id="hiddenPrevious" value="0" />
    <input type="hidden" id="hiddenTotal" value="0" />
    <input type="hidden" id="hiddenSection1" value="0" />
    <input type="hidden" id="hiddenSection2" value="0" />
    <input type="hidden" id="hiddenSection3" value="0" />
    </div>
    </form>
</body>
</html>
Eazy
Top achievements
Rank 1
 answered on 16 Jul 2010
7 answers
839 views

I have a problem with adding custom attributes to menuitems. They can be added in code behind (I have tested the attribute count and contents) but do not show up in the html markup client-side. Custom CSS classes are added without a problem.

I have tried two ways of adding custom attributes to the menuitems
-databinding
-manual build of the menu

In the attached file I have added an aspx page with code to illustrate the issue.

http://www.cipsoftware.nl/downloads/telerik%20menutest%202010-07-13.zip

Did I forget a property or setting?

Additional info: I am using version 2010 q2 beta build 623 but I have the same problem with version 2009 q3 1314 and al versions in between.

Kind regards,

Edwin Dirkzwager
CIP Software BV
The Netherlands
Edwin
Top achievements
Rank 1
 answered on 16 Jul 2010
3 answers
358 views
Hi,

I am using a RadTabStrip on an ASP.Net page, which has 4 tabs. Each of these tabs contain different user controls which in turn contain other web user controls. I have place the entire RadTabStrip and its corresponding RadMultipage in one panel. Now when any event gets fired from a grid of the user control in any of the tabs, it does not display a Loading panel; although the events fire properly and the page is updated.

On this page, there is a RadGrid which gets updated by an event from the user control (which is in a RadMultipage), and the grid in turn updates other user controls which are in other tabs and RadMultipages.

Note that the usercontrols are not added dynamically, they exist when the page is loaded. RadTabStrip, RadTab and multipage controls are placed in either asp:panels or div. So giving the controls another dynamic IDs does not seem to work.

Also, the page uses an AjaxManagerProxy control since the AjaxManager itself is used in the master page. Because it uses an AjaxManagerProxy control, I cannot explicitly display the loading panels through JavaScript since I cannot find OnRequestStart and OnResponseEnd in the proxy control's client settings.

Can you please guide me with an alternative way of achieving this? Or if I am missing something? I am not sure whether to keep the tab content in a seperate panel and give that ID in "UpdatedControl" in the Ajax Settings or give the entire panel as the "UpdatedControl". I've tried both: functionalities work in both cases but loading panel gets displayed in none.

Please help,

Thanks in advance

Kunal Vora
Software Developer
Logica UK Ltd.
London, England
Lenny_shp
Top achievements
Rank 2
 answered on 16 Jul 2010
3 answers
397 views
I'm having trouble re- DataBinding a combobox on a button click event.  On the initial page load I'm binding the combobox (this works fine) which holds report settings.  I'm allowing the user to type in a value on the combobox which enables a save link button.  When the user clicks on the link button, I save all the report criteria off to the database and want to DataBind the combobox so show the newly added Item to the list.  I've debugged the process and show that the new item is getting saved off to the database,  the database is returning all items (including newly added).  It also appears that new item is getting bound to the combobox but it does not display in the browser.

Aspx:
                <table border="0" cellpadding="0" cellspacing="0" style="background-color:White;">              
                <tr> 
                    <td style="padding-right:5px;"><asp:LinkButton ID="lnkbtnSave" runat="server" Enabled="false" OnClick="lnkbtnSave_Click">Save</asp:LinkButton></td>  
                    <td style="padding-right:5px;"><asp:LinkButton ID="lnkbtnSaveAs" Enabled="false" runat="server" OnClick="lnkbtnSave_Click">Save As...</asp:LinkButton></td>  
                    <td><telerik:RadComboBox ID="rcbRptSettings" runat="server" AllowCustomText="true" EmptyMessage="My Reports" LoadingMessage="Loading..." OnSelectedIndexChanged="rcbRptSettings_SelectedIndexChanged" AutoPostBack="true" Skin="Outlook" Width="250px"></telerik:RadComboBox></td>  
                    <td style="padding-left:5px;"><asp:LinkButton ID="lnkbtnDelete" runat="server" OnClientClick="return blockConfirm('Are you sure you want to delete this report?', event, 330, 100,'','AARates Delete My Report');" OnClick="lnkbtnDelete_Click" Enabled="false">Delete</asp:LinkButton></td>  
                </tr> 
                </table> 

Code behind:
        protected void Page_Load(object sender, EventArgs e)  
        {  
    
            if (!Page.IsPostBack)  
            {  
                BindSavedSettings(Master.loggedUser.UserReports);  
            }  
 
                              
        }  
 
        private void BindSavedSettings(List<UserReport> urReports)  
        {  
            rcbRptSettings.DataSource = urReports; //Master.loggedUser.UserReports;  
              
            rcbRptSettings.DataTextField = "Name";  
            rcbRptSettings.DataValueField = "UserReportID";  
            rcbRptSettings.DataBind();  
            rcbRptSettings.Items.Insert(0, new RadComboBoxItem("", ""));  
 
        }  
 
        protected void lnkbtnSave_Click(Object sender, EventArgs e)  
        {  
            //Saves existing report  
            bool settingsfound = false;  
            UserReport ursettings;  
            PgMessage.ClearMessages();  
 
            if (rcbRptSettings.Text != string.Empty)  
            {  
                //USED FOR GRID SETTINGS  
                //string grsettings = string.Empty;  
                //GridSettingsPersister persister = new GridSettingsPersister(ARGrid1);  
                //grsettings = persister.SaveSettings();  
 
                foreach (UserReport ur in Master.loggedUser.UserReports)  
                {  
                    if (ur.Name == rcbRptSettings.Text)  
                    {  
                        settingsfound = true;  
                    }  
                }  
                if (settingsfound)  
                {  
                    ursettings = UserReport.getByKey(Convert.ToInt32(rcbRptSettings.SelectedValue));  
                    SaveReportSettings(ursettings);  
                }  
                else  
                {  
                    //NEW Report Settings
                    ursettings = new UserReport();  
                    SaveReportSettings(ursettings);  
 
                    List<UserReport> urpt = UserReport.getByUserid(Master.loggedUser.Userid);  
                    BindSavedSettings(urpt);  //BindSavedSettings to add new report setting  
 
                }  
            }  
            else  
            {  
                PgMessage.DisplayMessage(PageMessage.MessageType.Information, "Report Setting name must be entered");  
            }  
 
 
        } 
Velmurugan
Top achievements
Rank 1
 answered on 16 Jul 2010
3 answers
378 views
Hi Telerik,

I have a radtreeview which is dynamically binded to database. Following is the table structure:

AreaId | ParentAreaId | AreaName | IsRoomLevel | IsExpanded

1. When the treeview is generated, I want to assignment the "OnNodeClick" event only to the nodes whose attribute IsRoomLevel = 'True', i.e. not all the nodes can trigger the OnNodeClick event. How to achieve this?

2. When the "OnNodeClick" event is on, the nodes cannot be double clicked to expand or shrink because the page will refresh when the node is clicked.

3. I want to save the status of the treeview, i.e. the expend status of each node. But it is not efficient if I save the status of all the nodes to the database every time the their status are changed.

Any suggestions for these three questions? Thanks!

Best regards,
Hank
Nikolay Tsenkov
Telerik team
 answered on 16 Jul 2010
1 answer
106 views
I am simply trying to read the selected value of an item that is selected in RadComboBox but I am unable to do so.  The SelectedValue value is always empty.  This is a pretty simple usage case so I don't understand why this should be difficult.  Does anyone know what is going on?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim cmd As New SqlCommand
    Dim con As New SqlConnection
    Dim da As New SqlDataAdapter
    Dim ds As New DataSet
 
    cmd.Connection = con
    con.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
 
    con.Open()
    cmd.CommandText = "select top 100 CustomerID, isnull(Title, '') as Title, FirstName, LastName, FirstName + LastName as FullName from saleslt.customer"
 
    da.SelectCommand = cmd
    da.Fill(ds)
 
    RadComboBox1.DataValueField = "CustomerID"
    RadComboBox1.DataTextField = "FullName"
 
    RadComboBox1.DataSource = ds
    RadComboBox1.DataBind()
End Sub
 
Protected Sub RadComboBox1_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
    Dim s As String
 
    s = e.Value
    s = RadComboBox1.SelectedValue
 
End Sub


<
telerik:RadComboBox ID="RadComboBox1" runat="server" Width="420"
    AllowCustomText="True" MaxHeight="300px" Filter="Contains" AutoPostBack="True">
    <HeaderTemplate>
        <ul>
            <li class="col1">Title</li>
            <li class="col2">First Name</li>
            <li class="col3">Last Name</li>
        </ul>
    </HeaderTemplate>
    <ItemTemplate>
        <ul>
            <li class="col1"><%#DataBinder.Eval(Container.DataItem, "Title").ToString()%></li>
            <li class="col2"><%#DataBinder.Eval(Container.DataItem, "FirstName").ToString()%></li>
            <li class="col3"><%#DataBinder.Eval(Container.DataItem, "LastName").ToString()%></li>
        </ul>
    </ItemTemplate>
</telerik:RadComboBox>
Helen
Telerik team
 answered on 16 Jul 2010
3 answers
427 views
For some reason, I cannot use DatePicker control.  I can use a regular textbox, plus a caledar icon.  I want to achieve the same thing as DatePicker, by clicking that icon, it shows a calendar, when a date is slected, the date is entered into the textbox.

Is that a easy way to do this?
Thomas
Top achievements
Rank 1
 answered on 16 Jul 2010
8 answers
203 views
If I wanted to navigate the right pane to an Anchor bookmark (#MySection) from a link in the left pane, would I want to use getExtContentElement and then location.hash in javascript?  Or is there a "built-in" Tererik method to do that? I definitely do not want to reload the contents of the page in the process.

I'm thinking about using a RadTree on the left side, in case that makes any difference.

Rob
Svetlina Anati
Telerik team
 answered on 16 Jul 2010
1 answer
95 views
Hello,

Please see my attached GRID where I amrked the issue in RED color. Please advise.
Princy
Top achievements
Rank 2
 answered on 16 Jul 2010
7 answers
214 views
Hello,

I am working with the 2008 Q2 version of the Rad Controls and try to fix the problem, that only one special button starting the progress manager and therefore the update.
I have different other buttons on my page, doing a full postback. When I press any of them the progressmanager starts. I tried your solution at http://www.telerik.com/community/forums/aspnet-ajax/upload/create-a-dedicated-submit-button-for-rad-upload.aspx
but it does not work. So I checked the __EVENTARGUMENT so that only the link button is allowed. But even with setting the input boxes to cleared, It does not work. The progressmanager still starts.

function startUploadSubmit(sender, args, uploadID, labelID) { 
            var upload = $find(uploadID); 
             
             
            //make sure, that there will be no problem 
            var eventTarget = document.getElementById('__EVENTTARGET'); 
            if (eventTarget.value == '<%= btnUploadFile.UniqueID %>') { }  
            else { 
                var fileInputs = upload.getFileInputs(); 
                for (var i = 0; i < fileInputs.length; i++) { 
                    upload.clearFileInputAt(i); 
                } 
                return; 
            }  
                                 
            var lblMessageElement = $get(labelID); 
            //is a file selected 
            var files = upload.getFileInputs(); 
            if (files[0].files.length == 0) { 
                args.set_cancel(true); 
                lblMessageElement.innerHTML = '<%= Encoda.Web.Settings.GetLocalizedString("Dialog#NoFileSelected") %>'
                return; 
            } 
            var valid = upload.validateExtensions(); 
            if (!valid) { 
                args.set_cancel(true); 
                lblMessageElement.innerHTML = '<%= Encoda.Web.Settings.GetLocalizedString("Dialog#WrongFileExtension") %>'
                return; WrongFileExtension 
            }            
        } 



I even tried to set the ProgressManager to RegisterForSubmit and then calling for the onclick event of the upload button the StartProgressPolling. Trying this the progressmanager does not start at all.

<telerik:RadScriptBlock runat="server">
       
    <script language="javascript" type="text/javascript">


function startFileUpload() {             
            var progManager = getRadProgressManager(); 
            RadProgressManager.StartProgressPolling(); 
        }
     </script>
</telerik:RadScriptBlock>
<telerik:RadProgressManager ID="progressManager" runat="server" OnClientSubmitting="startUploadSubmit" RegisterForSubmit="false" />      
 
<ucc:EncodaLinkButton Runat="server" ID="btnUploadFile" Caption="Dialog#StartUpload" OnClick="btnUploadFile_OnClick" OnClientClick="startFileUpload();" /> 


Any ideas, how to solve the problem, that the ProgressManager (and the upload) start only pn the specified button?

Genady Sergeev
Telerik team
 answered on 16 Jul 2010
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?