用Repeating Table来实现
从某个数据连接中读出要显示的数据,然后用重复表的形式显示出来。
例程:
if (!this.New) return;
XPathNavigator root = MainDataSource.CreateNavigator();
DataSource myDataSource = this.DataSources["DS1"];
XPathNavigator t1 = myDataSource.CreateNavigator();
XPathNodeIterator t2s = t1.Select("dfs:myFields/dfs:dataFields/d:DS1",NamespaceManager);
XPathNavigator options = root.SelectSingleNode("/my:myFields/my:options", NamespaceManager);
XPathNavigator optionFirst = root.SelectSingleNode("/my:myFields/my:options/my:option", NamespaceManager);
XPathNavigator myText;
myText = optionFirst.SelectSingleNode("my:Text", NamespaceManager);
string c2;
while (t2s.MoveNext())
{
XPathNavigator myOption = optionFirst.Clone();
myText = myOption.SelectSingleNode("my:Text", NamespaceManager);
c2 = t2s.Current.GetAttribute("C2", "");
myText.SetValue(c2)
options.AppendChild(myOption);
}
optionFirst.DeleteSelf();
options是重复表,包含两个节点:selected和text,selected是布尔型,text是多选框对应的文字