RadDropDownTree单击Hierachy项时获取选定的值

时间:2014-08-26 12:17:27

标签: c# asp.net telerik

嘿大家我正在使用raddropdowntree,我想在用户点击层次结构项时获得raddropdowntree的值。这是我的

aspx代码

<telerik:RadDropDownTree ID="RadDropDownTree1" runat="server" Width="400px" EnableFiltering="true"
            DataFieldID="COAId" DataFieldParentID="ParentCOAId" DataValueField="COAId" DataTextField="AccountDesc"
            Skin="Silk" FilterSettings-Highlight="Matches"
            OnEntryAdded="RadAutoCompleteBox1_EntryAdded" ExpandNodeOnSingleClick="true" AutoPostBack="true">
            <DropDownSettings Height="420px" OpenDropDownOnLoad="true"/>
            <ButtonSettings ShowClear="true" />
            <FilterSettings Highlight="Matches" Filter="Contains" EmptyMessage="Type   here to find a contact" />

        </telerik:RadDropDownTree>

此代码后面

public void RadAutoCompleteBox1_EntryAdded(object sender, DropDownTreeNodeDataBoundEventArguments e)
    {
        string ID = e.Entry.Value ;
    }

此代码有效,但问题是当我从层次结构中选择项目时。当我点击raddropdowntree边界的外侧后选择项目,所以这个事件发生.. 其他不是火。我想要将此事件项目选择称为什么问题。

1 个答案:

答案 0 :(得分:0)

使用客户端事件OnClientEntryAdding访问此属性。

<telerik:RadDropDownTree ID="rddTree" runat="server"
  OnClientEntryAdding="OnClientEntryAdding"
  DefaultMessage="Browse Systems..."
  Skin="Default" EnableFiltering="true"
  FilterSettings-Highlight="Matches" Font-Names="Segoe UI"
  FilterSettings-EmptyMessage="Search..."
  CheckBoxes="None">
  <DropDownSettings Height="150px" AutoWidth="Enabled" 
  CloseDropDownOnSelection="true" />
</telerik:RadDropDownTree>

...使用以下嵌入的javascript

<script type="text/javascript">
  function OnClientEntryAdding(sender, eventArgs) {

  //debugger;
  var Value = eventArgs.get_entry().get_value();
  //do something with it      
  }
</script>
相关问题