Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
107 views

This is My ClientSide code ,I am planing to sort the Tree items using MoveUp and move down option in Context menu

function RadTreeView1_ClientContextMenuItemClick(sender, eventArgs) {
            //to get the direction
            var Direction = eventArgs._menuItem.get_text();
            //to get the position clicked
            var Index = eventArgs._node.get_index();
            //to get the lenght of the tree node
            var length = eventArgs._node._parent._children._array.length;
            //to get all siblings
            var nodes = eventArgs._node._parent._children._array;
            var counter;

            if (Direction == "Move Up") {
                temp = eventArgs._node.get_text();
                eventArgs._node.set_text(eventArgs._node.get_previousSibling().get_text());
                eventArgs._node.get_previousSibling().set_text(temp)
            }
            else if (Direction == "Move Down") {
                temp = eventArgs._node.get_text();
                eventArgs._node.set_text(eventArgs._node.get_nextSibling().get_text());
                eventArgs._node.get_nextSibling().set_text(temp)
            }
            eventArgs._node.get_treeView().commitChanges(); 
             var tree = document.getElementById("ctl00_TreeContentPlaceHolder_RadPanelBar1_i0_RadTreeView1");
             tree.commitChanges();
           
      }

Move up and down is achived in the code but still i can not able to retain the sorted order of the Treeview using the code
In tree object i can not able to find any method like commitChanges()
it thoroughs an error says it can not contain any method,
please help me out to complete the task as soon as possible,this is urgent.
Thanks in advance





Veronica
Telerik team
 answered on 27 Jul 2010
1 answer
41 views
Dear All,

I am facing problem for performane. I am using grid for my each webpage. Add new record,Edit,cancel and paging taking more than 2 sec,how to reduce this time.If u can send me best practice for grid,my application will respone faster.......

best rgds
Azeheruddin khan
Maria Ilieva
Telerik team
 answered on 27 Jul 2010
5 answers
200 views
Hi guys,

If I want to databound rotator with a datasource, does it pre-load all of the item and then render all the data to the client? If so, does it slow down then page loading on client side because all of the record is pre-loaded? Thx.
Pero
Telerik team
 answered on 27 Jul 2010
2 answers
116 views
Hi,

I have changed my RadEditor's content to ContentAreaMode="Div" because Iframe was causing a few problems for me.
All is working ok, but the context menu's appear not in the right places, almost allways at the top of the page.
I think that is has to do with the context menu css that says position: absolute; and absolute position is to the last element that has relative or absolute position, no?

Here Is the RadEditor Declaration:

 

 

 

<telerik:RadEditor ContentAreaMode="Div" ExternalDialogsPath="~/EditorDialogs/" ID="txtSmallDescription" Runat="server" Height="350px" Width="680px" EnableResize="false" Skin="Windows7" MaxTextLength="150" ContentAreaCssFile="~/Style/EditorContentArea_RTL.css" StripFormattingOptions="All"> 
  <CssFiles> 
    <telerik:EditorCssFile Value="~/Style/EditEvent.css" /> 
  </CssFiles> 
  <Content></Content> 
</telerik:RadEditor>


Best Regards,
Guy

 

 

 

 

 

 

 

 

 

KinGuy
Top achievements
Rank 2
 answered on 27 Jul 2010
1 answer
237 views
Hello,
Is there a way to use the ajaxloading panel with a regular update panel?
The reason I want to do this is because I work with dundas charts and for some reason, these charts don't get painted if they have a scroll bar while they're inside an ajaxloading panel. they do work while inside a regular update panel though... (I asked why it happens on the dundas forums)

But I still want to work with the RadAjaxLoading pane because the rest of my website does. any way to trigger it on the update panel callback event?

Thanks in advanced.
Cori
Top achievements
Rank 2
 answered on 27 Jul 2010
3 answers
190 views
I have an "Explorer" style page with a treeview in the left pane and a detail pane on the right. I have quite a bit of functionality in the page, and it all seems to be working well, except for one scenario that I am trying to get to work.

The information in the Detail pane is created using XSLT. Some of the information is in the form of hyperlinks. I am using the onclick event of the anchor tags to trigger an event in javascript that will load the target information sent by the anchor into the detail pane. So, when the user clicks a hyperlink in the detail pane, the new page will load in the detail pane. I am using the onclick event to do this because controls created via Javascript cannot fire the server side events.

Anyway, all my code is working correctly. When the hyperlink is clicked, the javascript event fires and calls the explicitCallBack code in my example below. That code calls back to the server, and my server code calls to the database, gets the new data, and loads the new controls, all without error. But, the detail pane does not display the new data. It seems that I must expressly "refresh" the detail pane. Is that correct? And, if it is correct, how do I do that?

I will include the basic structure of the relevant part of my aspx page:
<telerik:RadCodeBlock ID="ExplorerCodeBlock" runat="server">
    <script language="javascript" type="text/javascript" src="scripts/editPage.js"></script>
    <script type="text/javascript">
    //<![CDATA[
    function handleHyperlink(target) {
        /* ... do some processing... */
        explicitCallBack(target);
    }
 
    function explicitCallBack(arg) {
        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
        ajaxManager.ajaxRequest(arg);
    }
    //]]>
    </script>
</telerik:RadCodeBlock>   
 
<telerik:RadAjaxManager ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="tvExplorer">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tvExplorer" />
                <telerik:AjaxUpdatedControl ControlID="pnlDetailWrapper" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="pnlDetailWrapper">
            <UpdatedControls>                  
                <telerik:AjaxUpdatedControl ControlID="pnlDetailWrapper" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager> 
<telerik:RadSplitter ID="RadSplitter1" CssClass="grid_12" Height="650" Width="100%" LiveResize="true"  runat="server">
    <telerik:RadPane ID="paneExplorer" CssClass="grid_6 alpha" runat="server">
        <telerik:RadTreeView ID="tvExplorer" runat="server" TabIndex="1" AccessKey="m"
          OnClientNodeClicked="OnClientNodeClicked"
          OnClientKeyPressing="OnClientKeyPressing"
          OnClientNodeDataBound="OnClientNodeDataBound"
          OnClientContextMenuItemClicking="OnClientContextMenuItemClicking"
          OnContextMenuItemClick="tvExplorer_ContextMenuItemClick"
          OnNodeClick="tvExplorer_NodeClick">
            <WebServiceSettings Path="DataSvcProxy.asmx" Method="GetRadTreeViewNodes" />
            <Nodes>
                <telerik:RadTreeNode runat="server" Text="My Project" Value="0" ClassID="0" PermClasses="0" ExpandMode="WebService" />
            </Nodes>
        </telerik:RadTreeView>
    </telerik:RadPane>
    <telerik:RadSplitBar ID="RadSplitBar1" CollapseMode="Forward" runat="server" />
    <telerik:RadPane ID="paneDetail" CssClass="grid_6 omega" runat="server">
        <asp:Panel ID="pnlDetailWrapper" runat="server">
            <asp:HiddenField ID="hdnOperationType" runat="server" />
            <asp:HiddenField ID="hdnOperationSource" runat="server" />
            <asp:Panel ID="pnlDetail" runat="server">
            </asp:Panel>
        </asp:Panel>
    </telerik:RadPane>
</telerik:RadSplitter>
Any advice you can give would really be appreciated.

Thanks very much.
Roger
Top achievements
Rank 1
 answered on 27 Jul 2010
4 answers
195 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
181 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
86 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
251 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
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?