This is a migrated thread and some comments may be shown as answers.

Issue with value of DataTextField

5 Answers 100 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
Giorgos
Top achievements
Rank 1
Giorgos asked on 14 Oct 2013, 01:21 PM
I have the following RadDropDownTree on my page:

<telerik:RadDropDownTree ID="rddtrForeas" runat="server" 
  EnableFiltering="True"
  DefaultMessage="Select sth"
  DataTextField="Title"           
  DataFieldID="SomeId"  
  CheckBoxes="SingleCheck"            
  ExpandNodeOnSingleClick="true"  
  D
ataValueField="SomeId"  
  DefaultValue="-1" 
  DataFieldParentID="ParentId">
     <ButtonSettings ShowCheckAll="False" ShowClear="true"></ButtonSettings>
     <DropDownSettings Height="400" AutoWidth="Enabled" CssClass="mis-rddtree" OpenDropDownOnLoad="False" ></DropDownSettings><br>           
     <
FilterSettings Filter="Contains" FilterTemplate="ByText" Highlight="Matches" EmptyMessage="Write here for filtering" ></FilterSettings>
</telerik:RadDropDownTree>

In my code behind inside Page_Load  I set the DataSource to a list of three items. I then perform data bind and then set the
SelectedValue to the Ids of the first and second item.

I have noticed that if the "Title" field of my objects contains two consecutive blank spaces or ends with a blank space the drop down
tree control does not function properly. I.e. you cannot deselect in any way the node with the "problematic" title.

5 Answers, 1 is accepted

Sort by
0
Giorgos
Top achievements
Rank 1
answered on 14 Oct 2013, 01:31 PM
Try binding for example to the following list object (inside Page_Load):

List<TreeEntry> lstData = new List<TreeEntry> {
   new TreeEntry { ParentId = null, SomeId = -100, Title = "First "},
    new TreeEntry { ParentId = -100, SomeId= 39252, Title = "Some  text"},
    new TreeEntry { ParentId = -100, SomeId = 39286, Title = "Third "}
                    };
rddtrForeas.DataSource = lstData;
rddtrForeas.DataBind();
rddtrForeas.SelectedValue = "39252, 39286";



0
Giorgos
Top achievements
Rank 1
answered on 16 Oct 2013, 07:33 AM
Did anyone have a look on this issue? 
0
Peter Filipov
Telerik team
answered on 16 Oct 2013, 12:10 PM
Hello Giorgos,

I setup a sample from the provided code and everything is working fine at my side. Could you please test the attached project and modify it in order to replicated the described behavior. In case that the issue appears without modifications let me know which version of the controls and browser you are using.

Regards,
Peter Filipov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Giorgos
Top achievements
Rank 1
answered on 16 Oct 2013, 01:02 PM
I added a new web form page to my existing project and copied inside it the code from my original post.
The issue is not reproducible.
 
However If I place the page containing the rad drop down tree inside a rad window that opens from another page
then the issue pops up again:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">

    function openRadWindow() {
        var oWnd;
        oWnd = $find("<%=rwDropDownTree.ClientID %>");        
        oWnd.Show();
    }
...

and

<telerik:RadWindowManager ID="rwmDialogs" runat="server" EnableShadow="true">
    <Windows>
        <telerik:RadWindow ID="rwDropDownTree" 
            runat="server"  
            NavigateUrl="~/App_WebForms/Files/PageWithRadDropDownTree.aspx"
            Modal="true"              
            InitialBehaviors="Default" 
            Width="850" Height="590">
        </telerik:RadWindow>

    </Windows>
</telerik:RadWindowManager>



0
Peter Filipov
Telerik team
answered on 18 Oct 2013, 08:29 AM
Hi Giorgos,

I have setup a sample from the provided code and still I could not reproduce the issue. Please test the attached project and modify it if needed.

Regards,
Peter Filipov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
DropDownTree
Asked by
Giorgos
Top achievements
Rank 1
Answers by
Giorgos
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or