Question 1 - Does the user have any control on the text that is displayed in the Radcombobox while using keyboard navigation.
ChangeTextOnKeyBoardNavigation = "true" or "false" just completely turns it on or off.
Question 2 - Is there any property that will return the index or text of the currently focussed item? eg. if i am currently highlighting the 6th item in the combobox items with my keyboard. (Selected item does not return the item that i just highlight during keyboard navigation)
If you need more information about what we are trying the achieve you can continue to read...
We are using the Radcombobox to autosuggest employees. For better user experience, what we want to do is - If the user tyes something like - 'smith', in all the auto suggested values we want to 'bold' the text 'smith' eg-
John Smith
Jonathon Smithson
Smith and others
so what we do is while populating the list of values to autosuggest, we use the <b> tags to format the text.
So baiscally we add
John <b>Smith</b>
<b>Smith</b> and others
etc...
This works perfectly and we can see the search results with Smith highlighted.
However, when we use the keyboard to navigate in this list of suggested values, the text 'John <b>Smith</b>' (with the html <b> tags) appear in the text box.
Please advise.
| function ShowAddUserPopup() { |
| var oWnd = $find("<%=AddUserPopup.ClientID%>"); |
| oWnd.setUrl('addUser.aspx'); |
| oWnd.show(); |
| } <
telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow ID="AddUserPopup" runat="server" Behavior="Close" Modal="True" Width="700px" Height="650px" VisibleStatusbar="False" OnClientClose="OnClientClose">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<
button onclick="ShowAddUserPopup();return false;" type="button">Add User</button>
|
| AddUserPopup.OpenerElementID = btnAddUser.ClientID; |
| AddUserPopup.NavigateUrl = "addUser.aspx"; |
| lblMessage.Text = "<script>ShowAddUserPopup()</script>"; |
| function ShowEditUserPopup() { |
| var oWnd = radopen('editUser.aspx', "EditUserPopup"); |
| } |
| <telerik:RadGrid ID="MyGrid" runat="server" |
| OnNeedDataSource="MyGrid_NeedDataSource" |
| OnItemDataBound="MyGrid_ItemDataBound" |
| OnInsertCommand="MyGrid_InsertCommand" |
| OnUpdateCommand="MyGrid_UpdateCommand" |
| OnDeleteCommand="MyGrid_DeleteCommand" |
| > |
| <MasterTableView DataKeyNames="Key" CommandItemDisplay="Top" EditMode="InPlace"> |
| <Columns> |
| <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" |
| <HeaderStyle Width="40px" HorizontalAlign="Center" /> |
| <ItemStyle Width="40px" HorizontalAlign="Center" /> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridTemplateColumn UniqueName="Category" HeaderText="Category"> |
| <ItemStyle Width="100px" /> |
| <HeaderStyle Width="100px" /> |
| <ItemTemplate> |
| <%#DataBinder.Eval(Container.DataItem, "Category.Name") %> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <telerik:RadComboBox ID="CategoryEdit" runat="server" |
| Width="100%" |
| DataSourceID="CategoryDataSource" |
| DataTextField="Name" DataValueField="Key" |
| SelectedValue='<%#Bind("CategoryKey") %>'> |
| </telerik:RadComboBox> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn UniqueName="Contact" HeaderText="Contact"> |
| <ItemStyle Width="150px" /> |
| <HeaderStyle Width="150px" /> |
| <ItemTemplate> |
| <%#DataBinder.Eval( Container.DataItem, "ContactName" )%> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <telerik:RadComboBox ID="ContactEdit" runat="server" |
| Width="100%" |
| DataSourceID="ContactDataSource" |
| DataTextField="Name" DataValueField="Key" |
| SelectedValue='<%#Bind("ContactKey") %>'> |
| <asp:CustomValidator ID="ContactOrDescriptionValidator" runat="server" |
| Display="Dynamic" |
| ErrorMessage="Item must have a contact or a description." |
| OnServerValidate="MyGrid_ContactOrDescriptionValidator_ServerValidate" |
| > |
| </asp:CustomValidator> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn UniqueName="Description" HeaderText="Description"> |
| <ItemStyle Width="150px" /> |
| <HeaderStyle Width="150px" /> |
| <ItemTemplate> |
| <%#DataBinder.Eval( Container.DataItem, "Description" )%> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <telerik:RadTextBox ID="DescriptionEdit" runat="server" |
| Width="100%" MaxLength="50" |
| Text='<%#Bind("Description") %>'> |
| </telerik:RadTextBox> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridButtonColumn ButtonType="ImageButton" UniqueName="DeleteColumn" |
| CommandName="Delete" |
| <HeaderStyle Width="20px" HorizontalAlign="Center" /> |
| <ItemStyle Width="20px" HorizontalAlign="Center" /> |
| </telerik:GridButtonColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |