I have solve this issue, it turns out that I can not use the form
loading event, and secondly, I should
use this.ViewInfos.Initial property.
void FormCode_Startup(object sender, EventArgs e)
{
XPathNavigator nav = this.MainDataSource.CreateNavigator();
string viewName = nav.SelectSingleNode("/my:myFields/my:View",
NamespaceManager).Value;
if (!string.IsNullOrEmpty(viewName))
{
this.ViewInfos.Initial = this.ViewInfos[viewName];
}
}
Thanks
> I don't understand how to load a view by using the from openning
> rules. But the rule itself is not dynamically enough. The best options
[quoted text clipped - 18 lines]
>
> thanks
Mackenzie, Jason - 12 Nov 2007 19:58 GMT
You need to wireup the form load event in the startup event:
public void InternalStartup()
{
EventManager.FormEvents.Loading += new
LoadingEventHandler(FormEvents_Loading);
}
>I have solve this issue, it turns out that I can not use the form
> loading event, and secondly, I should
[quoted text clipped - 35 lines]
>>
>> thanks
Fred - 13 Nov 2007 04:45 GMT
Thanks for reminding that. Actually, my test will of cause ensure that
handler get called. The problem is not the handler can not be called,
but the behavior of the handler.
I have test that the in the Loading event, the form switching
techniques like the following has not effect
this.ViewInfos.SwitchView(viewName);
or this.ViewInfos.Initial = this.ViewInfos[viewName];
but they are legal event in Form service.
StartUp event can solve the problem in InfoPath client, be can not
used in form service. That is dilemma.
Thanks
> You need to wireup the form load event in the startup event:
>
[quoted text clipped - 44 lines]
>
> - Show quoted text -