Hello,
I have a radcombobox control that gets filled with data on page load ( at code behind ) and I have a rad button on the page, that has a clientclicking event on it, inside this event, I read the selected value of the radcombobox , using jquery selector, and do some validation on it.
The problem is happening whenever I start typing (filtering) inside the radcombobox then pressing the enter key to select the item, it is clearing the selected value of the control, so whenever I read the selected value of the radcombobox after pressing the enter key to select the item, the value gets displayed as empty string. It is working fine if I select an item using a normal mouse click.
The markup for the radcombobox is:
<rad:RadComboBox ID="lstEntity" runat="server" Width="95"></rad:RadComboBox>The code used to fill the radcombobox is:
With lstEntity .Items.Clear() .DataSource = _Entities.EntityCodes.OrderBy(Function(o) o) .DataBind() .Items.Insert(0, New Telerik.Web.UI.RadComboBoxItem("- Select -", "0"))End With
The code used in the rad button's ClientClicking event to read the selected value of the radcombobox is:
var selectedEntity = $find($("[id$='lstEntity']")[0].id).get_value();Therefore, the selectedEntity is being filled with an empty string, whenever I select an item from the radcombobox through an enter key. As a note, the get_text() function always returns the correct selected text, regardless of the way I use to select the item (mouse click or Enter key).
So I am not sure if this is an issue with the control itself, or it is in the way I am binding the data with control or even reading the selected value. I would appreciate it if someone can help me.
Regards
<Telerik:RadGrid ID="rgYears" runat="server" AutoGenerateColumns="False" CellSpacing="0" Width="200px" GridLines="None" Skin="Office2007" Font-Names="Calibri,Arial" AllowSorting="true"> <MasterTableView DataKeyNames="DateClosedYear" ShowHeader="false"> <Columns> <Telerik:GridBoundColumn DataField="DateClosedYear" HeaderText="Year" UniqueName="DateClosedYear"> </Telerik:GridBoundColumn> </Columns> <SortExpressions> <Telerik:GridSortExpression FieldName="DateClosedYear" SortOrder="Descending" /> </SortExpressions> <DetailTables> <Telerik:GridTableView runat="server" Name="MonthDetails" DataKeyNames="DateClosedMonth" Width="176px" NoDetailRecordsText="No Child Records" ShowHeader="false"> <Columns> <Telerik:GridBoundColumn DataField="DateClosedMonthName" HeaderText="Month" UniqueName="DateClosedMonth"> </Telerik:GridBoundColumn> </Columns> <ParentTableRelation> <Telerik:GridRelationFields DetailKeyField="DateClosedYear" MasterKeyField="DateClosedYear" /> </ParentTableRelation> <DetailTables> <Telerik:GridTableView runat="server" Name="OrderDetails" DataKeyNames="OrderNumber" Width="143px" NoDetailRecordsText="No Child Records" ShowHeader="true"> <Columns> <Telerik:GridButtonColumn ButtonType="LinkButton" CommandName="SelectOrderNumber" DataTextField="OrderNumber" FilterControlAltText="FilterOrderNumber column" HeaderText="Order Number" UniqueName="OrderNumber" SortExpression="OrderNumber" ShowSortIcon="false"> </Telerik:GridButtonColumn> </Columns> <ParentTableRelation> <Telerik:GridRelationFields DetailKeyField="DateClosedMonth" MasterKeyField="DateClosedMonth" /> </ParentTableRelation> </Telerik:GridTableView> </DetailTables> </Telerik:GridTableView> </DetailTables> </MasterTableView> </Telerik:RadGrid>'rgYears dataGrid is already databound'Get all the Months and Years for Orders Closed'The below section of the code is called at Page LoadDim OrdersMonthYear = dHelper.OrdersClosedMonthYear(oNumber) 'Get the Month and Year of the last accessed OrderIf (rgYears.MasterTableView.Items.Count > 0) Then Dim rgYearsItem As GridDataItem = rgYears.MasterTableView.FindItemByKeyValue("DateClosedYear", OrdersMonthYear.DateClosedYear) If Not IsNothing(rgYearsItem) Then rgYearsItem.Expanded = True Dim rgMonthsItem As GridDataItem = rgYearsItem.ChildItem.NestedTableViews(0).FindItemByKeyValue("DateClosedMonth", OrdersMonthYear.DateClosedMonth) If Not IsNothing(rgMonthsItem) Then rgMonthsItem.Expanded = True Dim rgOrdersItem As GridDataItem = rgMonthsItem.ChildItem.NestedTableViews(0).FindItemByKeyValue("OrderNumber", oNumber) 'Last Accessed Order Number from the table If (Not IsNothing(rgOrdersItem)) Then rgOrdersItem.Selected = True End If End If End IfEnd If