How to set Tab index in proper order

Posted by Krv under ASP.NET on 10/25/2013 | Points: 10 | Views : 1358 | Status : [Member] | Replies : 3
Hi,

I have an dropdown list based on whihc i will disable/ enable few controls on the page. Accordingly my tab index should work.
Eg if my dropdown is selected as 'A', i make visiable all control c1,c2,c3,c4

If my dropdow is selectged as 'B' i make visiable c1,c2,c6,c4 (ie, c6 is next to c2) and my tab index also move accordingly.

How to achive this.

I am using VS2010

Thanks,
R.Vasanth
MCTS(SQL Server & BI)
http://bigdatatech.blogspot.com



Responses

Posted by: Bandi on: 10/25/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Write down code for DropDown OnSelectionChanged event
If the selected value is 'B' then give tabindex order for specific controls as follows:
c1.TabIndex = 1;
c2.TabIndex = 2;
c6.TabIndex = 3;
c4.TabIndex = 4;

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Krv, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/25/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi,
I have tested with the following code
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
GetData(DropDownList1.SelectedItem.Value); // The GetData() method is for Grid View Binding
if (DropDownList1.SelectedItem.Value == "B")
{
txtGrdData.TabIndex = 1;
TextBox1.TabIndex = 2;
TextBox2.TabIndex = 4;
TextBox3.TabIndex = 3;
TextBox4.TabIndex = 6;
TextBox5.TabIndex = 5;
TextBox6.TabIndex = 7;
}
}


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Krv, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/25/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Click on "Mark as Answer " if you solved the issue; otherwise post us back

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Krv, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response