Switch view by Code

N

Nicolas

Hi

I want to use buttons to switch view instead of the build in view switcher.
I switch the view by code like this

public void btnGroups_Clicked(object sender, ClickedEventArgs e)
{
this.ViewInfos.SwitchView("GroupView");
}

What I have noticed is that if I'm on a quite large view with a long
repeating table it can take several minutes to switch view by the button
compared to use the built in switch view drop down. How can this be?
It's a form running under InfoPath Forms Services.

BR,
Niclas
 
F

Frederik Van Lierde

Why do you use Code?

Go to the properties of the Button
Select Action: Rules and Custom Code
Click on Rules...
Add a Rule through clicking on the Add Button
Click on the Add Action
Select Switch Views
Select the Vieuw

Easy out of the box, and NO CODING

I hope this can help you

Frederik Van Lierde
http://www.SilversandsAssociates.com
http.//BlueInfoPath.blogspot.com
 
N

Nicolas

Hi

Because I have 8 views so that gives me 8 buttons. To set rules for all of
them I had to do it 64 times instead of setting the same name for the buttons
and use an event handler. Unfortunately this made the form so slow on view
switching so I had to use rules instead.

BR,
Niclas
 
S

Swathi

Hi,
You can set the rules for buttons in one view. And copy those controls and
paste in other views. This makes your job easier instead of setting rules in
every view.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top