Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
187 views
Hi,

I'm trying to change a ComboBoxItem's text from client side when then text of a radTextBox in another radPanel was changed. It seems to work (partially) but as soon as the page refreshes, I lose all changes and the radComboBox is repopulated with the default values, even though the new values are still present in the textbox. Here is the client side code for the change:
Javascript:
function RefreshPreneursPrenom(sender, args) {
                            var cell = sender.get_element().parentNode.parentNode;
                            var index = cell.parentNode.rowIndex - 1;
                            var prenom = (sender.get_element().value);
 
                            var combo = $find("<%= rcbPreneur.ClientID %>");
                            if (combo != null) {
                                var items = combo.get_items();
                                var comboItem = new Telerik.Web.UI.RadComboBoxItem();
                                var comboItem = items.getItem(index);
 
                                var nomComplet = comboItem.get_text();
                                var nomComplet2 = nomComplet.split("  ");
                                var nomFamille = nomComplet2[1];
                                var nomComplet3 = (prenom.concat("  ", nomFamille));
 
                                comboItem.set_text(nomComplet3);
                                combo.trackChanges();
                                combo.commitChanges();
                                comboItem.Select;
 
                                document.getElementById("<%= rapPreneur.ClientID %>").style.display = 'block';
                            }
                        }

and here's the code that is executed when the panel is being populated:
VB:
Dim i As Int32
        Dim listeAssures As New OCollection(Of Assure)
 
        For i = 0 To NbreVoyageurs - 1
 
            Dim assure As New Assure
            Dim rgItem As GridDataItem = DirectCast(rgDetailsVoyageurs.MasterTableView.Items(i), GridDataItem)
            Dim item As New Telerik.Web.UI.RadComboBoxItem
 
            Dim id As New HiddenField
            id = DirectCast(rgItem("Prenom").FindControl("IDVoyageur" + (i + 1).ToString), HiddenField)
            assure.IDClient = CLng(id.Value)
 
            Dim prenom As New Telerik.Web.UI.RadTextBox
            prenom = DirectCast(rgItem("Prenom").FindControl("PrenomVoyageur" + (i + 1).ToString), Telerik.Web.UI.RadTextBox)
            assure.Prenom = prenom.Text
 
            Dim nom As New Telerik.Web.UI.RadTextBox
            nom = DirectCast(rgItem("Nom").FindControl("NomVoyageur" + (i + 1).ToString), Telerik.Web.UI.RadTextBox)
            assure.Nom = nom.Text
 
            'construction de la date de naissance
            Dim txtJour As New Telerik.Web.UI.RadNumericTextBox
            txtJour = DirectCast(rgItem("Date de naissance").FindControl("DateNaissanceJourVoy" + (i + 1).ToString), Telerik.Web.UI.RadNumericTextBox)
            Dim jourNaissance As Integer = CInt(txtJour.Value)
 
            Dim txtMois As New Telerik.Web.UI.RadComboBox
            txtMois = DirectCast(rgItem("Date de naissance").FindControl("DateNaissanceMoisVoy" + (i + 1).ToString), Telerik.Web.UI.RadComboBox)
            Dim moisNaissance As Integer = CInt(txtMois.SelectedValue.ToString)
 
            Dim txtAnnee As New Telerik.Web.UI.RadNumericTextBox
            txtAnnee = DirectCast(rgItem("Date de naissance").FindControl("DateNaissanceAnVoy" + (i + 1).ToString), Telerik.Web.UI.RadNumericTextBox)
            Dim anneeNaissance As Integer = CInt(txtAnnee.Value)
 
            assure.DateNaissance = New Date(anneeNaissance, moisNaissance, jourNaissance)
 
            Dim checkACharge As New CheckBox
            checkACharge = DirectCast(rgItem("A Charge").FindControl("AChargeVoy" + (i + 1).ToString()), CheckBox)
            assure.IsPersonneACharge = checkACharge.Checked
 
            Dim age As Integer = Today.Year - assure.DateNaissance.Year
 
            If assure.DateNaissance.Month > Today.Month OrElse _
               (assure.DateNaissance.Month = Today.Month AndAlso assure.DateNaissance.Day > Today.Day AndAlso _
                assure.DateNaissance.Day <> Today.Day) Then
                'The current year is not yet complete.
                age -= 1
            End If
 
            If (age > 15) Then
                item.Text = assure.Prenom + "  " + assure.Nom
                item.Value = assure.IDClient.ToString
                rcbPreneur.Items.Add(item)
            End If
 
        Next
 
        Components.AddRange(listeAssures)
 
        rcbPreneur.DataBind()
 
        rapPreneur.Visible = True


Any help would be greatly appreciated
Thank you

Sam
Sammy78
Top achievements
Rank 2
 answered on 27 Jul 2010
4 answers
174 views
I was wondering how I show the Current Month and Previous Month when setting MultiviewColumns="2".... Currently it shows the current and next month which doesn't work well for my application. The user can only select dates up to the current date.

Levi
Levi
Top achievements
Rank 1
 answered on 27 Jul 2010
1 answer
84 views

After I click on save button , I want to leave the appointment form open.

If I writing e.cancel , the appointment form is still open , but all the data completed , clear.
 (like a new appointment )

 

How can I leave open appointment with the selected data?

 

Veronica
Telerik team
 answered on 27 Jul 2010
3 answers
239 views
Hi,

I am trying to do a filter function for my RadScheduler, with a .NET checkboxlist as filter UI control. However, on the AppointmentDataBound event, I cant seem to get anything but NULL from the

e.Appointment.Resources.GetResource function.

Heres my event code:

 

protected

 

void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)

 

{

e.Appointment.Visible =

true;

 

 

foreach (ListItem item in CheckBoxList1.Items)

 

{

 

 

if (item.Selected)

 

{

 

Resource userRes = e.Appointment.Resources.GetResource("Vogne", item.Value);

 

 

if (userRes != null)

 

{

e.Appointment.Visible =

true;

 

}

}

}

}


And here's a part of my markup:

<

 

telerik:RadScheduler ID="RadScheduler1" runat="server" DataDescriptionField="Description"

 

 

DataEndField="End" DataKeyField="ID" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID"

 

 

DataSourceID="sdsSchedule" DataStartField="Start" DataSubjectField="Subject"

 

 

EnableDescriptionField="True" Skin="Vista" Culture="Danish (Denmark)" FirstDayOfWeek="Monday"

 

 

Height="100%" LastDayOfWeek="Sunday" SelectedView="WeekView" OnAppointmentCreated="RadScheduler1_AppointmentCreated"

 

 

OnFormCreated="RadScheduler1_FormCreated" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound">

 

 

<ResourceTypes>

 

 

<telerik:ResourceType DataSourceID="sdsCategoryA" ForeignKeyField="CategoryA" KeyField="catid"

 

 

Name="Vogne" TextField="catname" />

 

 

</ResourceTypes>

 

 

<AppointmentTemplate>

 

 

<div>

 

 

<b>

 

<%

# Eval("Subject") %>(<%# DataBinder.Eval(Container.Appointment, "Start", "{0:t}") %>-<%# DataBinder.Eval(Container.Appointment, "End", "{0:t}") %>)</b><br />

 

<%

# Eval("Vogne.Text") %>

 

 

</div>

 

 

</AppointmentTemplate>

 

 

</telerik:RadScheduler>

 


...
...

<

 

telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">

 

 

<asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True" DataSourceID="sdsCategoryA"

 

 

DataTextField="catname" DataValueField="catid" OnSelectedIndexChanged="CheckBoxList1_SelectedIndexChanged">

 

 

</asp:CheckBoxList>

 

 

</telerik:RadAjaxPanel

 



As you can see, I have a resource, and the CheckBoxList uses the same datasource as the resourceprovider in the Scheduler.

On inserting break point on Resource userRes = e.Appointment.Resources.GetResource("Vogne", item.Value); I can see that the resource has an item that matches my selcted item from the CheckBoxList, but it still evaluates to NULL.

Please HEEELLLP :-)

Regards

Jesper

Peter
Telerik team
 answered on 27 Jul 2010
1 answer
107 views

When I insert  appointment , after I click on save button ,I link to database . and the new appointment added twice.

Once -  updated from the database , and again – display only.
 The appointment that view appears, disappears after the page refresh.

 

How can I remove the second appointment?
Peter
Telerik team
 answered on 27 Jul 2010
1 answer
122 views
hi,


in my rotator, i fixed the width,

rotator work only if the width  is upto 350px,   i want to keep rotator for width 600px, if increase the width it's not rotating and also image is not displaying.

i dont know what is the error,  below is my rotator code. 


<telerik:RadRotator ID="radrotDoctorImages" runat="server" Height="190px" Width="350px"
             ScrollDuration="1000" FrameDuration="10"  RotatorType="AutomaticAdvance" 
                    ItemWidth="110" Skin="Office2007" CssClass="rotatorStyle"   >
           
                     <ItemTemplate>
                    <table  >
                        <tr>
                            <td>
                           
                                 <a href="Listofdoctors.aspx">
                                    <asp:Image ID="Image7" runat="server" Height="100px" Width="100px" ImageUrl="~/Images/dr5.jpg" />
                                 </a>
                               
                            </td>
                        <tr>
                            <td>
                                <asp:Label ID="lblName" runat="server" Text="lblName"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                             <td>
                                <asp:Label ID="lblSpecialty" runat="server" Text="lblSpecialty"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                             <td>
                                <cc1:Rating ID="Rating6" runat="server"
                                         CurrentRating="3"  
                                         MaxRating="5"  
                                         StarCssClass="star_rating"
                                         WaitingStarCssClass="star_saved"
                                         FilledStarCssClass="star_filled"
                                         EmptyStarCssClass="star_empty"   >
                                </cc1:Rating>
                            </td>
                        </tr>
                    </table>
                 </ItemTemplate>
                      


kindly fix this issue,

regards
Priya
                
Pero
Telerik team
 answered on 27 Jul 2010
1 answer
161 views
I use radcontrols Editor 2.0 to custom field in sharepoint ,it is inherited from SPFieldMultiLineText (type name: myrichtext), when i run on sharepoint  , its ok but when i use sharepoint designer 2007 i receive error  " Failed to render 'column name A' column because of a error in the 'myrichtext' field type control. see details in log. Exception message: the RadControls folder was not found."

Thanks
Thanh
Rumen
Telerik team
 answered on 27 Jul 2010
1 answer
226 views
Hi,
I have a question/problem about implementing my own  handler.
I have follow the image uploader example in the demo but is seems that I cant get my handler to work.
To be more specific,if I have not set the radupload to use my handler it works as expected.
If I set it to use my handler (HttpHandlerUrl="~/CustomUploaderHandler.ashx") the uploading animation its always displayed and the file
isnt uploaded.One more thing is that I have set a breakpoint inside the Process method of the Handler but its not hitted.
Am I missing some configuration that is not mentioned in the demo?

the HttpHandler code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Web.UI;
 
namespace UploaderTest
{
    public class CustomUploadHandler : AsyncUploadHandler, System.Web.SessionState.IRequiresSessionState
    {
 
        protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
        {
            base.Process(file, context, configuration, tempFileName);
CustomAsyncUploadResult result = CreateDefaultUploadResult<CustomAsyncUploadResult>(file);
 
            return result;
        }
 
         
 
    }
}
T. Tsonev
Telerik team
 answered on 27 Jul 2010
1 answer
111 views
hi,

the rotator is working fine in the normal aspx page, but if place the same rotator in the content page it's not working ,
i want to use rotator also in the my master page it's also not working , how can i use , below is the my design code


this is in my aspx page
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
<telerik:RadRotator id="RadRotator2" runat="server" ScrollDirection="Up" 
RotatorType="AutomaticAdvance" InitialItemIndex="0"  
ScrollDuration="300" ItemWidth="500px" Width="510px" Height="100px" 
ItemHeight="100px">
<ItemTemplate>
    
<strong>
<a href="Default.aspx"> <asp:Image ID="Image1" ImageUrl="images/electronic-medical-records-systems.jpg"    runat="server" /></a>
</strong>
<br />
<span >Starts:</span>
<span ></span>
<br />
</ItemTemplate>
<SlideShowAnimation Type="Fade" Duration="300" />
</telerik:RadRotator>
</asp:Content>


kindly provide me solution i'm in urgent need..

regards
priya
Pero
Telerik team
 answered on 27 Jul 2010
2 answers
303 views

How to make fileupload and store into database in Radgrid EditFormSettings in a popup window.
Shinu
Top achievements
Rank 2
 answered on 27 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?