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

Diffrent Tabstrip based on checkbox.

1 Answer 41 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Stephan
Top achievements
Rank 1
Stephan asked on 03 Jan 2012, 06:54 PM
I have a page i am building that I am using a Checkbox to allow the user to see all sales reps "Select * from sales" or if it's not checked "Select * from sales where isnull(term_date)"  I have kind of went through a lot of the postings, but I never found would that kind of matched this scenario.  Should I be searching for firing the postback from the checkbox since that is what is causeing the change?  I will look for that but not sure how I will code it yet.

1 Answer, 1 is accepted

Sort by
0
Stephan
Top achievements
Rank 1
answered on 03 Jan 2012, 07:58 PM
With much trial and error I think I got it.

rotected void ChBViewAll_CheckedChanged(object sender, EventArgs e)
    {
        if (ChBViewAll.Checked == true)
        {
            AccessDataSource1.SelectCommand = "SELECT [lastname] FROM [salesrep]";
        }
        else if (ChBViewAll.Checked == false)
        {
            AccessDataSource1.SelectCommand = "SELECT [lastname] FROM [salesrep] where isnull(termdate) ";
        }
        Page.Session["selectCommand"] = AccessDataSource1.SelectCommand;
        RadTabStrip1.DataBind();
 
    }
    protected void RadTabStrip1_Init(object sender, EventArgs e)
    {
        if (!IsCallback)
            Page.Session["selectCommand"] = null;
 
        if (Page.Session["selectCommand"] != null)
            AccessDataSource1.SelectCommand = (string)Page.Session["selectCommand"];
            RadTabStrip1.DataBind();
    }
Tags
TabStrip
Asked by
Stephan
Top achievements
Rank 1
Answers by
Stephan
Top achievements
Rank 1
Share this question
or