Diffrent Tabstrip based on checkbox.

2 posts, 0 answers
  1. Stephan
    Stephan avatar
    33 posts
    Member since:
    Jun 2012

    Posted 03 Jan 2012 Link to this post

    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.
  2. Stephan
    Stephan avatar
    33 posts
    Member since:
    Jun 2012

    Posted 03 Jan 2012 Link to this post

    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();
        }
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top