Thread: Filtering data
View Single Post
  #6 (permalink)  
Old June 6th, 2013, 11:15 AM
Erik Severiens Erik Severiens is offline
Authorized User
Points: 51, Level: 1
Points: 51, Level: 1 Points: 51, Level: 1 Points: 51, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2013
Posts: 12
Thanks: 3
Thanked 0 Times in 0 Posts
Default half way there

thanks Imar, exactly what I needed. To finalize I am troubled why the value of RV is not transferred in below code between the 2 routines

Code:
public partial class Zoek : System.Web.UI.Page
{
    public Double RV;

    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

 
    protected void CBKleur_SelectedIndexChanged(object sender, EventArgs e)
    {
        // calculate value for where clause
        RV = 0;
        for (int i = 1; i < CBKleur.Items.Count; i++)
        {
            if (CBKleur.Items[i].Selected) { RV += Math.Pow(2, (i - 1)); }
        }
    }

    protected void SqlDataSource11_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {
        
        Int32 ColorSelected = Convert.ToInt32(RV);
        e.Command.Parameters["@ColorId"].Value = ColorSelected;
    }
}
best Regards,

Erik
Reply With Quote