It is actually quite easy to do. To setup the event handler, right click on the button control and go to properties.
In the general tab, there will be a button with the label, "Edit Form Code".
Clicking this button will register the event handler and also create the procedure shell.
The [<] button click event logic would be like so;public void CTRL7_5_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator nav = MainDataSource.CreateNavigator();
XPathNodeIterator NodeIterator = nav.Select("/my:myFields/my:group1/my:group2", NamespaceManager);
XPathNavigator node;
while (NodeIterator.MoveNext())
{
node = NodeIterator.Current.CreateNavigator();
node.SelectSingleNode("my:txtWeek1", NamespaceManager).SetValue(node.SelectSingleNode("my:txtWeek2", NamespaceManager).Value);
node.SelectSingleNode("my:txtWeek2", NamespaceManager).SetValue(node.SelectSingleNode("my:txtWeek3", NamespaceManager).Value);
node.SelectSingleNode("my:txtWeek3", NamespaceManager).SetValue(node.SelectSingleNode("my:txtWeek4", NamespaceManager).Value);
node.SelectSingleNode("my:txtWeek4", NamespaceManager).SetValue("0");
}
}
The [>] button click event logic would be like so;
public void CTRL8_5_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator nav = MainDataSource.CreateNavigator();
XPathNodeIterator NodeIterator = nav.Select("/my:myFields/my:group1/my:group2", NamespaceManager);
XPathNavigator node;
while (NodeIterator.MoveNext())
{
node = NodeIterator.Current.CreateNavigator();
node.SelectSingleNode("my:txtWeek4", NamespaceManager).SetValue(node.SelectSingleNode("my:txtWeek3", NamespaceManager).Value);
node.SelectSingleNode("my:txtWeek3", NamespaceManager).SetValue(node.SelectSingleNode("my:txtWeek2", NamespaceManager).Value);
node.SelectSingleNode("my:txtWeek2", NamespaceManager).SetValue(node.SelectSingleNode("my:txtWeek1", NamespaceManager).Value);
node.SelectSingleNode("my:txtWeek1", NamespaceManager).SetValue("0");
}
}
Just be sure to change the XPath expressions to suit your form controls.