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

if (tabStrip1.SelectedTab == Tab1)

2 Answers 32 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Barry
Top achievements
Rank 1
Barry asked on 29 Oct 2010, 05:36 PM
1st timer... New "B" lol,  just started learning C# 3 moths ago and using telerik for the 1st time... really cool components and lots of fun... not knowing (yet) how it all works I have the following that is close to working as I'd like but need to 'ForceDataReload(AchRadGridView)'
from a 'tabStrip1.SelectedTab' :)

So far I have a mess where it goes like this...

protected void TabSelected(object sender, EventArgs e)
  {
       
      if (tabStrip1.SelectedTab == Tab1)
      {
          Session["SessionData-AchFilter"] = "ALL";
          tabStrip1.SelectedIndex = 0;
 
      }
 
 
      if (tabStrip1.SelectedTab == Tab2)
      {
          Session["SessionData-AchFilter"] = "NOT";
          tabStrip1.SelectedIndex = 1;
           
      }
 
 
      if (tabStrip1.SelectedTab == Tab3)
      {
          Session["SessionData-AchFilter"] = "APP";
          tabStrip1.SelectedIndex = 2;
        
      }
 
 
      if (tabStrip1.SelectedTab == Tab4)
      {
          Session["SessionData-AchFilter"] = "UNA";
          tabStrip1.SelectedIndex = 3;
      
      }
 
 
      if (tabStrip1.SelectedTab == Tab5)
      {
          Session["SessionData-AchFilter"] = "REJ";
          tabStrip1.SelectedIndex = 4;
 
      }
       
        
  }

The above seems to work to show my "selected" tab on each click and assuming my session parm is being set... when I add this to it my "grid" does not update...

if (tabStrip1.SelectedTab == Tab1)
   {
       Session["SessionData-AchFilter"] = "ALL";
       tabStrip1.SelectedIndex = 0;
       ForceDataReload(AchRadGridView);
   }

The 'ForceDataReload(AchRadGridView);' worked when I was doing the same desired "refresh" on a basic button:
//protected void ALL_Click1(object sender, EventArgs e)
//{
//    if (Globals.Page.IsValid)
//    {
 
 
//        Session["SessionData-AchFilter"] = "ALL";
 
 
//        ForceDataReload(AchRadGridView);
 
//    }
//}
So I started looking at maybe a "TabClick" but cannot figure out the syntax or proper use to achieve the same effect as the button; that is when the button was clicked the grid used the new assigned parm "All" as a filter in the "fill" to give me a new list in my grid and I want to do it with the good looking telerik tab strip :)

Sorry if long winded... and if I am making no sense..

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Nov 2010, 10:03 AM
Hello Berry,


I am not quite sure about the issue since I am unaware of the aspx mark-up you used.

See the following code:
protected void RadTabStrip2_TabClick(object sender, RadTabStripEventArgs e)
{
    switch (RadTabStrip2.SelectedTab.Text)
    {
        case "Tab1Text":
            //Statement 1
            break;
        case "Tab2Text":
            //Statement 2
            break;
             . . .
        default:
            break;
            //Statement 3
    }
}


Have you ajaxified the controls on page? If so, you need to set the AjaxSettings properly to update the controls.
AJAX Manager

Could you paste the mark-up so that I can help you better?


-Shinu.
0
Barry
Top achievements
Rank 1
answered on 01 Nov 2010, 02:17 PM
I was using the wrong syntax...

OnClientTabSelected="TabSelected"

instead of

OnTabClick="TabSelected"
Tags
TabStrip
Asked by
Barry
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Barry
Top achievements
Rank 1
Share this question
or