Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
regarding tab focus
posted

I have a tab control with three tabs

There is a mandatory field in tab1.

If we select tab3 and click on the button in tab3 it is display a message that mandatory fields requires input

Now is there any way to change the focus from tab3 to tab1 automatically because the mandatory field is in tab1

  • 185
    posted

    Hi RamaKrishna,

    Assuming that there is a textbox in the first tab; to make the selected tab to be the first tab if the text of the textbox is null even if we click other tabs, the following code should help :

    protected void UltraWebTab1_TabClick(object sender, WebTabEvent e)

    {

    TextBox tb = this.UltraWebTab1.Tabs.GetTab(0).FindControl("TextBox1") as TextBox;

    if (tb.Text == "")

    {

    this.UltraWebTab1.SelectedTabObject = this.UltraWebTab1.Tabs.GetTab(0);

     

    }

    }