Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
386 views
Hi, I have a page with several textboxes and comboboxes which all seem to work fine. The issue I have is with one textbox tb_Service and a combobox cmb_Service. What I have is tb_Service is a readonly textbox with a button (but_Modify). When the button is clicked a div is made visible revealing cmb_Services and two buttons to add or delete services. So when the user clicks modify, they select a service from the combobox and click add or delete buttons. These buttons have clientside java which will add or delete the service from tb_Services.
The code for the add is...
function butServiceAddClick() {
            var ServiceSelected = $('#cmbx_Service').val().toUpperCase();
            if (ServiceSelected == "PLEASE SELECT...") {
                //No Service selected so do nothing and exit
                return true;
            } else {
                var tb = $('#tb_Services');
                var oldvalue = tb.val().toUpperCase();
                var ServiceList = oldvalue + ";";
                if (/ServiceSelected + ";"/i.test(ServiceList)) {
                    //The selected Service is already in the list
                    //Do nothing and exit
                    return true;
                } else {
                    var newtext = "";
                    if (ServiceList == ";") {
                        newtext = ServiceSelected;
                    } else {
                        newtext = ServiceList + " " + ServiceSelected;
                    }
                    tb.val(newtext);
                    registerChange(tb, oldvalue, newtext);
                }
            }
        }

The code for deleting is similar and both codes work fine. In a test I added two sevices and ended up with tb_Services displaying SERVICE A; SERVICE B

I have another button which does a save. This is done in the code behind. When I look at what tb_Services.Text equates to at a breakpoint it is an empty string which is its value when the page was first populated. If I go to a record which already has a Service and add another the textbox displays correctly but once again when I click the save button and check the value of tb_Services is only has the original service and not the one I added. What am I doing wrong?
Vasil
Telerik team
 answered on 24 Jul 2013
1 answer
164 views
Hello,

I am trying to apply 3 different colors to the appointment based on the selected resources but it aint working. Any ideas why? Thank you.

<telerik:RadScheduler  ID="RadScheduler1"  />
   .......
        <ResourceTypes>
            <telerik:ResourceType DataSourceID="SqlDataSource2" ForeignKeyField="PeopleID" KeyField="ID"
                Name="User" TextField="People" />
        </ResourceTypes>
        <ResourceStyles>
            <telerik:ResourceStyleMapping Type="User" Text="Dodo" ApplyCssClass="rsCategoryBlue" />
            <telerik:ResourceStyleMapping Type="User" Text="Maya" ApplyCssClass="rsCategoryOrange" />
            <telerik:ResourceStyleMapping Type="User" Text="Tata" ApplyCssClass="rsCategoryGreen" />
        </ResourceStyles>


Thank you TELERIK in advance for your help. 





Zura Chikhladze
Top achievements
Rank 1
 answered on 24 Jul 2013
1 answer
105 views
I am using Drag and Drop to reorder tabs functionality in my project.
Its working fine as along as i drop tab on some other tab in the tab strip.

When i try to drop at end of the tab strip after last tab its not re-ordering. I want to implementation this in my project.
Any help will be appreciated. Please see the attached image.

Thanks
Dimitar Terziev
Telerik team
 answered on 24 Jul 2013
3 answers
387 views
hi all
I have 3 level Rad grid hierarchy.
I want each detail table has specific header backcolor.how can I do that?
Mohamed Yasin
Top achievements
Rank 1
 answered on 24 Jul 2013
1 answer
116 views
Hi Team and Dear all,

I have ready to creat web applications using Control Telerik.

When I not use Telerik Control in Page Login after published in IIS.
I call my web in URL ,: http://localhost:8080/
event button click is Fine and Work call code behind Process..

but, when I using Control Telerik,like RadScriptmanager and others...
when I click button Login,that not work...
When I call URL this "http://localhost:8080/" it's no work, but when I add specific page like " http://localhost:8080/default.aspx" ,it;'s work..

in IE,Firefox and GoogleChome it's not Work....

this, my code, my be i was wrong something or anything else...
please help me..
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="eRTE.Default" %>
<!DOCTYPE html>
 
<head runat="server">
    <title>eRTE</title>
    <link href="~/Content/Site.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
         
         
    <div>
    <asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
        </telerik:RadStyleSheetManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Metro">
        </telerik:RadWindowManager>
     
    </div>
    <div style="height: 175px">
     
    </div>
 
        <div style="height: 150px">
            <table style="width: 100%">
                <tr>
                    <td align="center" colspan="3">
                        <img alt="logo" src="Images/logosystem.png" />
                    </td>
                </tr>
                <tr>
                    <td style="width: 40%"></td>
                    <td>
                        <table style="width: 100%">
                            <tr><td>
                                    <span style="font-size: 13px;color: #666;">USERNAME</span>
                                </td><td><span style="font-size: 13px;color: #666;">PASSWORD</span>
                                     </td></tr>
                            <tr><td>
                                         <telerik:RadTextBox runat="server" ID="tbusername" AutoCompleteType="Disabled"></telerik:RadTextBox>
                                </td><td>
                                         <telerik:RadTextBox runat="server" ID="tbpass" TextMode="Password" AutoCompleteType="Disabled"></telerik:RadTextBox>
                                     </td></tr>
                            <tr><td>
                                    <asp:Button Text="Login" ID="btnLogin" runat="server" CssClass="buttonsubmit" Width="75px" OnClick="btnLogin_Click"/>                                </td><td></td></tr>
                        </table>
                         
                    </td>
                    <td style="width: 35%"></td>
                </tr>
                <tr>
                    <td style="width: 40%"> </td>
                    <td>
                             <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbusername" CssClass="field-validation-error" ErrorMessage="The user name field is required." /><br />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbpass" CssClass="field-validation-error" ErrorMessage="The password field is required." />
     
                    </td>
                    <td style="width: 35%"> </td>
                </tr>
            </table>
 
        </div>
        <div style="height: 250px"></div>
        <div style="text-align: center; color: #333;font-size: 12px;" >
Copyright ©  <%: DateTime.Now.Year.ToString() %>· All rights reserved.
        </div>
    </form>
</body>
</html>

and this code behind

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace eRTE
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Form.DefaultButton = btnLogin.ClientID;
            Form.DefaultFocus = tbusername.UniqueID;
            if (!IsPostBack && (Request.Cookies["__LOGINCOOKIE__"] == null || Request.Cookies["__LOGINCOOKIE__"].Value == ""))
            {
 
                Session.Abandon();
                Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
            }
 
 
 
        }
 
        private void AddRedirCookie(string userdata)
        {
        }
 
        protected void btnLogin_Click(object sender, EventArgs e)
        {
 
           //this my code process event login,
          // when I using control telerik, can't  proses to this event...why..???
        }
 
 
    }
}

trims a lot,

best reagrds,

chester
BabaYa
Top achievements
Rank 1
 answered on 24 Jul 2013
1 answer
197 views
I have a screen that has a Radgrid.  The radgrid uses a user control for the edit form.  When the edit button is pressed on the grid it loades the user control.  The User control is just a series of textboxes that are bound to the data from the grid.
<asp:TextBox ID="FamilyID" runat="server" value='<%# DataBinder.Eval(Container, "DataItem.FamilyID") %>'></asp:TextBox>

On the load event of this control there are a series of buttons that I want to make visible depending on the values in the text boxes.  The ossue I am having is since the values are set with DataBinder.Eval they do not have a value on the page_Load event.  How do I get the values so I can alter the screen?



Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Jul 2013
2 answers
121 views
Hi,

I cannot fix this issue about missing resource value. On the radScheduler it shows Telerik.Web.UI.Resource instead of the value. Any ideas? thank you.
here is the code:

<telerik:RadScheduler ID="RadScheduler1"
    CustomAttributeNames="EndTime,StartTime" CssClass="testing" OnClientAppointmentResizing="pereventResize"
    OnClientAppointmentMoveStart="PreventDragDrop" runat="server" DataEndField="EndTime"
    DataKeyField="Id" DataSourceID="SqlDataSource1" DataStartField="StartTime" DataSubjectField="Subject"
    Height="" Skin="Office2010Blue" StartEditingInAdvancedForm="False" DayEndTime="20:00:00"
    DayStartTime="09:00:00" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" OnAppointmentInsert="RadScheduler1_AppointmentInsert"
    OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" WorkDayEndTime="20:00:00"
    WorkDayStartTime="09:00:00" AllowDelete="False" DataDescriptionField="Description"
    DataRecurrenceField="RecData" DataRecurrenceParentKeyField="RecParrent"
    EnableDescriptionField="True">
    <ResourceTypes>
        <telerik:ResourceType DataSourceID="SqlDataSource2"
            ForeignKeyField="MeetingRoomID" KeyField="ID" Name="Floor"
            TextField="MeetingRoomFloor" />
    </ResourceTypes>
    <AppointmentTemplate>
        <div>
            <h2>
                <%#Eval("Subject") %>
            </h2>
            <p>
                <%#Eval("Description") %></p>   <%#Eval("Floor") %>
                 
        </div>
    </AppointmentTemplate>
</telerik:RadScheduler>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CompanyInfoEventsConnectionString %>"
    DeleteCommand="DELETE FROM [Event] WHERE [Id] = @Id" InsertCommand="INSERT INTO [Event] ([Subject], [StartTime], [EndTime], [Description], [RecParrent], [RecData], [MeetingRoomID]) VALUES (@Subject, @StartTime, @EndTime, @Description, @RecParrent, @RecData, @MeetingRoomID)"
    SelectCommand="SELECT * FROM [Event]"
     
    UpdateCommand="UPDATE [Event] SET [Subject] = @Subject, [StartTime] = @StartTime, [EndTime] = @EndTime, [Description] = @Description, [RecParrent] = @RecParrent, [RecData] = @RecData, [MeetingRoomID] = @MeetingRoomID WHERE [Id] = @Id">
    <DeleteParameters>
        <asp:Parameter Name="Id" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="Subject" Type="String" />
        <asp:Parameter Name="StartTime" Type="DateTime" />
        <asp:Parameter Name="EndTime" Type="DateTime" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="RecParrent" Type="Int32" />
        <asp:Parameter Name="RecData" Type="String" />
        <asp:Parameter Name="MeetingRoomID" Type="Int32" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="Subject" Type="String" />
        <asp:Parameter Name="StartTime" Type="DateTime" />
        <asp:Parameter Name="EndTime" Type="DateTime" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="RecParrent" Type="Int32" />
        <asp:Parameter Name="RecData" Type="String" />
        <asp:Parameter Name="MeetingRoomID" Type="Int32" />
        <asp:Parameter Name="Id" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
 
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
    ConnectionString="<%$ ConnectionStrings:CompanyInfoEventsConnectionString %>"
    DeleteCommand="DELETE FROM [MeetRoomFloor] WHERE [ID] = @ID"
    InsertCommand="INSERT INTO [MeetRoomFloor] ([MeetingRoomFloor]) VALUES (@MeetingRoomFloor)"
    SelectCommand="SELECT * FROM [MeetRoomFloor]"
    UpdateCommand="UPDATE [MeetRoomFloor] SET [MeetingRoomFloor] = @MeetingRoomFloor WHERE [ID] = @ID">
    <DeleteParameters>
        <asp:Parameter Name="ID" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="MeetingRoomFloor" Type="String" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="MeetingRoomFloor" Type="String" />
        <asp:Parameter Name="ID" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
Zura Chikhladze
Top achievements
Rank 1
 answered on 24 Jul 2013
11 answers
151 views
I am using Telerik ASPX / AJAX v.2011.3.1305.40

I have a page with a RadButton and an AsyncUpload (see aspx code below) a- along with other controls. If I first select a file using the AsyncUpload it will display the selected file (and waits until I click another button to actually do something with it). However, if I click btnClear, it clears the AsyncUpload control back to its original state. What do I need to do to prevent this from happening?

Thanks,
Andy

        <script type="text/javascript">
            function btnClear_Click( sender, eventArgs )
            {
                var ddl = $find( "<%= dropdownlist.ClientID %>" );
                ddl.set_text( "" );
                ddl.trackChanges();
                ddl.get_items().getItem( 0 ).set_text( "" );
                ddl.commitChanges();
                var tree = ddl.get_items().getItem( 0 ).findControl( "treeview" );
                var selectedNode = tree.get_selectedNode();
                if ( selectedNode != null )
                    selectedNode.set_selected( false );
            }
        </script>

             <telerik:RadButton ID="btnClear" runat="server" Text="" OnClientClicked="btnClear_Click"
                ToolTip="Clear setting">
                <Icon PrimaryIconCssClass="rbRemove" PrimaryIconLeft="4" PrimaryIconTop="4" />
            </telerik:RadButton>

           <div class="upload-panel">
                <h6>
                    1. Select .SEW file to import:</h6>
                <telerik:RadAsyncUpload ID="UploadControl" runat="server" MaxFileInputsCount="1"
                    AllowedFileExtensions="sew" />
            </div>

Bozhidar
Telerik team
 answered on 24 Jul 2013
7 answers
223 views
I want to set the control text but don't know how to get a hold of the control that is within a radgrid. Can someone help?
I have another thread related to this but it was mixed with insert form. I thought it'd be better to have a different thread for it.

Also, RadButton1_Click() is not even invoked if there is RequiredFieldValidator and the field value is empty. How can RequiredFieldValidator be disabled when the button is clicked so that it invokes RadButton1_Click() ?

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div>
  <telerik:RadButton runat="server" ID="RadButton1" AutoPostBack="true" Text="fill data"  ButtonType="LinkButton" onclick="RadButton1_Click"></telerik:RadButton>
</div>
  
<telerik:RadAjaxPanel runat=server>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
            ShowStatusBar="True" GridLines="None"  OnNeedDataSource="RadGrid1_NeedDataSource"   OnUpdateCommand="RadGrid1_UpdateCommand"
            OnInsertCommand="RadGrid1_InsertCommand" OnCreateColumnEditor="RadGrid1_CreateColumnEditor"
            OnPreRender="RadGrid1_PreRender" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated">
             
            <MasterTableView DataKeyNames="id" CommandItemDisplay="Top">
                <Columns>
                    <telerik:GridBoundColumn HeaderText="Emp" DataField="emp" UniqueName="emp">
  
 
protected void RadButton1_Click(object sender, EventArgs e)
{
        //set the text of emp to something else. How to get a hold of the control in here?
}
Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Jul 2013
5 answers
243 views
Hi

When I select date from the raddatepicker, it is displayed in mm dd yy format in the date input. So how can I change the selected date format to dd mm yyyy format?

Thankyou
Needha
Shinu
Top achievements
Rank 2
 answered on 24 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?