Control views in Multiview based on Checkbox values

Posted by Sina under C# on 7/29/2014 | Points: 10 | Views : 617 | Status : [Member] | Replies : 0
Hi,

I need a immediate help regarding views and checkboxes.

The design is as such:
I have 4 checkboxes, a Multiview with 6 views.

The 1st checkbox value is related to the 2nd view, i.e. only if checkbox 1 is checked, need to load View2. Similarly if checkbox2 is checked, load View3 and goes on with next views.
There are Forward and Back buttons to navigate from one view to another.

if (!(MultiView1.ActiveViewIndex > MultiView1.Views.Count - 1))
{
if (Chk1.Checked)
{
MultiView1.ActiveViewIndex = 1;
}
else if (Chk2.Checked)
{
MultiView1.ActiveViewIndex = 2;
}
else if (Chk3.Checked)
{
MultiView1.ActiveViewIndex = 3;
}
else if (Chk4.Checked)
{
MultiView1.ActiveViewIndex = 4;
}
else
{
MultiView1.ActiveViewIndex = 5;
}
}
else
{
MultiView1.ActiveViewIndex = 5;
}
}


This is the coding I have done; but theres an issue, like if every time the forward button is clicked, it comes to this event and checks for checkbox checked event. For eg, Consider I have checked Checkboxes 2 and 4. From View0 (initial View) it goes to View2. Clicking on forward button, stays on the same page (since it checks for checkbox checked). The checkbox values are to be loaded dynamically.

@Sina


Responses

(No response found.)

Login to post response