Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
297 views
I believe I have identified a bug with the RadDropDownTree control when it is used on a page with the AjaxManager but is not one of the updated controls of an Ajax postback. I have noticed and captured where the RadDropDownTree only has one selected value, but when checking the RadDropDownTree's SelectedValue it often has the selected value listed multiples times after the Ajax postback. Below is the example code I put together and steps I am able to reproduce the issue.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadDropDownTreeTest.aspx.cs" Inherits="ALPS.Net.Development.RadDropDownTreeTest" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadDropDownList1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadDropDownList2" />
                        <telerik:AjaxUpdatedControl ControlID="SelectedValue" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        <div>
            <telerik:RadDropDownList ID="RadDropDownList1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadDropDownList1_SelectedIndexChanged">
                <Items>
                    <telerik:DropDownListItem Value="alpha" Text="Alpha" Selected="true" />
                    <telerik:DropDownListItem Value="num" Text="Numeric" />
                </Items>
            </telerik:RadDropDownList>  
        </div>
        <div>
            <telerik:RadDropDownList ID="RadDropDownList2" runat="server"></telerik:RadDropDownList>
        </div>
        <div>
            <telerik:RadDropDownTree ID="RadDropDownTree1" runat="server" DataFieldParentID="ParentID" DataFieldID="ID" DataTextField="Text" DataValueField="Value">
            </telerik:RadDropDownTree>
        </div>
        <div>
            <asp:Label ID="SelectedValue" runat="server" />
        </div>
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace ALPS.Net.Development
{
    public partial class RadDropDownTreeTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RadDropDownTree1.DataSource = GetData();
            RadDropDownTree1.NodeDataBound += RadDropDownTree1_NodeDataBound;
 
            if (!IsPostBack)
            {
                BuildAlphaList();
                RadDropDownTree1.DataBind();
            }
 
            SelectedValue.Text = RadDropDownTree1.SelectedValue;
        }
 
        void RadDropDownTree1_NodeDataBound(object sender, Telerik.Web.UI.DropDownTreeNodeDataBoundEventArguments e)
        {
            if (e.DropDownTreeNode.Text == "Text2 ")
                e.DropDownTreeNode.CreateEntry();
        }
 
        public DataTable GetData()
        {
            DataTable table = new DataTable();
            table.Columns.Add("ID");
            table.Columns.Add("ParentID");
            table.Columns.Add("Value");
            table.Columns.Add("Text");
 
 
            table.Rows.Add(new String[] { "1", null, "customValue1", "Text1 " });
            table.Rows.Add(new String[] { "2", "1", "customValue2", "Text2 " });
            table.Rows.Add(new String[] { "3", "2", "customValue3", "Text3 " });
            table.Rows.Add(new String[] { "4", "3", "customValue4", "Text4 " });
            table.Rows.Add(new String[] { "5", "3", "customValue5", "Text5 " });
            table.Rows.Add(new String[] { "6", "5", "customValue2", "Text6 " });
            table.Rows.Add(new String[] { "7", "6", "customValue2", "Text7 " });
            table.Rows.Add(new String[] { "8", "7", "customValue2", "Text8 " });
            table.Rows.Add(new String[] { "9", "1", "customValue9", "Text9 " });
            table.Rows.Add(new String[] { "10", "1", "customValue10", "Text10 " });
 
            return table;
        }
 
        public void BuildAlphaList()
        {
            RadDropDownList2.Items.Clear();
 
            RadDropDownList2.Items.Add(new DropDownListItem { Value="A", Text="A" });
            RadDropDownList2.Items.Add(new DropDownListItem { Value = "B", Text = "B" });
            RadDropDownList2.Items.Add(new DropDownListItem { Value = "C", Text = "C" });
        }
 
        public void BuildNumList()
        {
            RadDropDownList2.Items.Clear();
 
            RadDropDownList2.Items.Add(new DropDownListItem { Value = "1", Text = "1" });
            RadDropDownList2.Items.Add(new DropDownListItem { Value = "2", Text = "2" });
            RadDropDownList2.Items.Add(new DropDownListItem { Value = "3", Text = "3" });
        }
 
        protected void RadDropDownList1_SelectedIndexChanged(object sender, DropDownListEventArgs e)
        {
            if (e.Value == "alpha")
                BuildAlphaList();
            else
                BuildNumList();
        }
    }
}

STEPS:
  1. Load the page.
  2. From the RadDropDownTree control select the top most node "Text1"
  3. From the first RadDropDownList select Numeric and notice the value of the label ("customValue1")
  4. From the first RadDropdownList select Alpha and again notice the value of the label ("customValue1,customValue1")
  5. From the first RadDropDownList select Numeric again and again view the label ("customValue1,customValue1,customValue1")

If you were to add the RadDropDownTree as an updated control in AjaxManager, reload the page, and try the steps again the selected value works as expected having only the single selected value.

If you were to comment out the AjaxManager, reload the page, and try the steps again the Selected value operates as expected only having the single SelectedValue.

Bug or is there some setting I am missing? Thanks!

Kerry
Gregory
Top achievements
Rank 1
 answered on 15 Jun 2017
0 answers
63 views
Hi all,

I have an issue with scheduler timeline view.
As I mentioned in title, I would like to add background color all the way from start time of first event to end time of last event as the attached image.
And also, I want to set different color based on time range in same event.
How could I do that?

Thanks,
Lin
Coolasia
Top achievements
Rank 1
 asked on 15 Jun 2017
4 answers
927 views
I am trying to display a page in a RadWindow however the RadWindow closes by its self after about a second of loading the new window. I was hoping someone could look at my code and see if they notice anything wrong. I am new to Telerik so sorry if something seems strange.

<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
    <script type="text/javascript">
        function openWindow() {      
            var window = $find('<%= crWindow.ClientID %>');
            alert("open");
            window.show();
        }
        function onWindowClosed(sender, args) {
            var ajaxManager = $find('<%= RadAjaxManager.GetCurrent(Page).ClientID %>');
            ajaxManager.ajaxRequest('crWindow');
            alert("close");
        }
    </script>
</telerik:RadScriptBlock>
<telerik:RadWindowManager runat="server" ID="crWindowManager">
    <Windows>
        <telerik:RadWindow runat="server" ID="crWindow" Title="test"
            Behaviors="Close,Resize,Move,Maximize" OnClientClose="onWindowClosed" VisibleOnPageLoad="False"
            VisibleStatusbar="False" Modal="true" Width="480px" Height="390px" KeepInScreenBounds="true" ShowContentDuringLoad="true"/>
    </Windows>
</telerik:RadWindowManager>
 
 <asp:Table ID="tableMasterMCA" runat="server">
                <asp:TableRow>
                    <asp:TableCell>
                        <asp:LinkButton ID="lnkCR" runat="server">Test</asp:LinkButton>
                    </asp:TableCell>
                </asp:TableRow>
</asp:Table>
I want the window to pop up when the link button is clicked so I also applied some c# code to the link button.

protected void Page_Load(object sender, EventArgs e)
        {
            lnkCR.Attributes.Add("onclick", "return openWindow()");
            crWindow.NavigateUrl = "~/Pages/CRForm.aspx";
        }
Arun
Top achievements
Rank 1
 answered on 15 Jun 2017
2 answers
288 views

Hello,

I have a page with a RadListView multiple RadGrids binded on server-side with the same type of objects and same columns.

I would like to apply filters on all grids when changing a filter on one of them (client-side).

 

I tried handling the following client events on each grid :

- OnCommand, in order to save filters of the filtered grid in a global javascript variable

- OnGridCreated, in order to apply saved filters on each grid using the javascript variable

 

However, it doesn't work because my javascript variable is back to null value when hitting OnGridCreated event.

Is there a better way to do this (= sharing filters between multiple grids) ?

 

Thanks in advance.

Best regards,

Eva

Eyup
Telerik team
 answered on 15 Jun 2017
2 answers
318 views

With regard to this previous thread: http://www.telerik.com/forums/rad-grid-import-from-excel

2 things.

First, I've examined the code and I'm a bit confused.  I thought this technique only worked for XLS format, not the new XLSX.

Second, I have had an app up and running for some time now using that technique to import xls files without any problem. 

Now, suddenly I cannot perform this operation locally in Visual Studio.2012  (It was working fine during the original development)  It crashes: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

 As far I know this is part of the package Microsoft Access Database Engine 2010.  I have version 14 installed.

Suggestions?

 

Karen
Top achievements
Rank 1
 answered on 14 Jun 2017
3 answers
827 views

Hello,

Is there any event, if I select some item from DropDownList?

Yes, I know, there is onEntryAdded and onClientEntryAdded events, but only if mode is set to Token, and moreover this events are fired also when AutoCompleteBox lost focus.

I need to things:
1. set AllowCustomEntry to "true"
2. read item value, when user select some item from DropDownList

How can I do it?

Thanks
Jan

Vessy
Telerik team
 answered on 14 Jun 2017
0 answers
111 views

First Issue,I have two controls (a radcombox and a Treelist controls) on my page which SelectedIndexChanged populating data from database.Now I want to fire NeedDatasource event on SelectedIndexChanged. How I could do that ?

 

Second issue,

As I am facing some issues with needdatasource, I have manually binded using databind method of radtreelist.After binding it shows only parent nodes at first.

After clicking on PageSize combo it loads with respective child nodes.Why this is happening here ?

Suvankar
Top achievements
Rank 1
 asked on 14 Jun 2017
13 answers
473 views
I have tried searching for this problem, so if this is a re-post please link to the original.

I have two RadComboBoxes inside a RadAjaxPanel (the latter is actually in a MasterPage), along with a regular ASP.NET Button control. When I click the button, I go through some simple validation to see if the user selected an item in each RadComboBox. If not, I make a <div> element visible with an error message, and exit the subroutine.

This works fine. However, after the button click and error message is displayed, the RadComboBox controls are disabled. They don't look grayed out, but clicking the drop down arrow does nothing, and mousing over the controls doesn't produce the normal "highlight" effect that shows when controls are active.

Regular ASP.NET DropDownLists do not produce this behavior. I'd really like to use the RadComboBox because I want the checkbox feature of it, but if I can't get this figured out in a couple hours I'll have to switch to ListBox controls.

Any idea what's wrong here?

Thank you,

Adam
Peter Milchev
Telerik team
 answered on 14 Jun 2017
4 answers
353 views

I am having serious issues with Telerik controls not loading on the page without multiple refreshes.

Here is an example of how the HTML editor looks when it fails to load. This happens to pretty much all controls.

Using version: Telerik_UI_for_ASP.NET_AJAX_2015_3_930_Dev

No errors are being thrown on the server.

 

Omar
Top achievements
Rank 1
 answered on 14 Jun 2017
2 answers
499 views

Hello,

I was looking for a way to allow my users to customize their interface, and to choose the columns order of some grids.
I choose a client side reordering as I don't want the data to be reloaded (too long) and the ongoing modification lost (GridEditMode.Batch).

In order to save the preference of the user, I susbcribed to the "onColumnSwapped" event. Then my javascript function calls "ajaxManager.ajaxRequest" (which save the new columns order into my database)

First issue: in my "RadAjaxManager1_AjaxRequest" (server side), if I look the OrderIndex of the columns of my grid, they have their original values. Is this normal ?

I could decide to save the profil with a custom button "Save Column Order" (I tried and the OrderIndex are the correct / changed ones)  but I want to avoid adding another button to my interface.

As I already have the column order stored server side, I decided to simply send the two argument from the javascript to my server function:

var sourceIndex = eventArgs.get_gridSourceColumn().get_element().cellIndex;
var destinationIndex = eventArgs.get_gridTargetColumn().get_element().cellIndex;

Then I make the change myself server side and save it to the database.

It works well with GridClientSettings.GridColumnsReorderMethod.Swap.

However it doesn't work with GridClientSettings.GridColumnsReorderMethod.Reorder. The javascript event is called multiple times (swapping multiple time) but the ajax request is called only 1 time ! (the last time).

Example: If I move the 4th columns to position 1.
The javascript event is called 3 times with the following parameters (source, destination):
4,3
3,2
2,1

And my AjaxRequest is called only 1 time with the following parameters (source, destination):
2,1

Any suggestions ?

Thank you

Guilhem
Top achievements
Rank 1
 answered on 14 Jun 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?