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

[Solved] weird tab order

2 Answers 85 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Slinger
Top achievements
Rank 1
Slinger asked on 03 Sep 2009, 06:01 PM
Hello,

I've got a problem with multiple combo-boxes tab order.

Setup two combo boxes with autopostback="true" and give each one a

OnSelectedIndexChanged event.  I have an ajaxmanager on the page.  If you select an item in the first control and press tab the focus goes somewhere off the form.  If you select an item in the first list and press shift-tab the focus works correctly.  Or if you put a non-post back control between the two combo boxes the focus works correctly.

I don't think using the OnClientSelectedIndexChanging event is an option because the selecting values from these drop downs drive other UI options.

Any ideas?

Thanks,
Rob

2 Answers, 1 is accepted

Sort by
0
Slinger
Top achievements
Rank 1
answered on 04 Sep 2009, 03:29 PM

Here is a sample page that demonstrates the behavior:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="NFS.Policy.Web.WebForm1" ValidateRequest="false"%> 
 
<%@ Register TagPrefix="rad" Namespace="Telerik.WebControls" Assembly="RadGrid.Net2" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<body> 
   <form runat="server" id="mainForm" style="width:100%;">              
      Zero: <asp:TextBox ID="TextBox1" runat="server" /><br />   
      First: <rad:RadComboBox ID="cbxFirst" MarkFirstMatch="true" SelectOnTab="true" OnSelectedIndexChanged="cbxFirst_SelectedIndexChanged" AutoPostBack="true" runat="server" /><br /> 
      Second: <rad:RadComboBox ID="cbxSecond" MarkFirstMatch="true" SelectOnTab="true" OnSelectedIndexChanged="cbxSecond_SelectedIndexChanged" AutoPostBack="true" runat="server" /><br /> 
      Third: <asp:TextBox ID="txtThird" runat="server" /> 
 
      <rad:RadAjaxManager ID="AjaxManager" runat="server" /> 
   </form> 
</body> 
</html> 

And the code-behind:
      protected void Page_Load(object sender, EventArgs e)  
      {  
         if (!Page.IsPostBack)  
         {  
            ArrayList itemsList = new ArrayList();  
            itemsList.Add("One");  
            itemsList.Add("Two");  
            itemsList.Add("Three");  
 
            cbxFirst.DataSource = itemsList;  
            cbxFirst.DataBind();  
 
            cbxSecond.DataSource = itemsList;  
            cbxSecond.DataBind();  
         }  
      }  
 
      protected void cbxFirst_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)  
      {  
      }  
 
      protected void cbxSecond_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)  
      {  
      }  
   }  
 

Sure would be nice to be able to tab through the fields on this form.  I'm using the 2009 Q1 release of the controls.
0
Yana
Telerik team
answered on 07 Sep 2009, 12:53 PM
Hi Rob,

Thank you for providing the sample code.

Actually it is expected behavior, because when you select an item, the page postbacks and  the combobox loses the focus. I cannot reproduce the behavior with Shift+Tab at our side.

Greetings,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Slinger
Top achievements
Rank 1
Answers by
Slinger
Top achievements
Rank 1
Yana
Telerik team
Share this question
or