Hi,
What I understood is you are allowing the user to select date via. Date Picker and what you want to do is you want to make a list for all the dates that are selected by user right?
For that please follow the steps for implementing your functionality.
· For saving all the dates selected by user you need to have a repeating field in which we save all the dates selected by user.
o Add a group in the data source (named " DatesSelectedByUser "). In that add a repeating field (named as “dates”).
· After adding the repeating field in a group. Add an OnAfterChange Event for the date picker. In that add the below lines of code.
[InfoPathEventHandler(MatchPath = "/my:myFields/my:DatePicker", EventType = InfoPathEventType.OnAfterChange)]
public void DatePicker_OnAfterChange(DataDOMEvent e)
{
if (e.IsUndoRedo || e.Operation != "Insert")
{
return;
}
IXMLDOMDocument2 sampleDom = (IXMLDOMDocument2)thisXDocument.CreateDOM();
sampleDom.async = false;
sampleDom.validateOnParse = false;
sampleDom.setProperty("SelectionNamespaces", formNameSpace);
sampleDom.load("sampleData.Xml");
IXMLDOMNode dates = sampleDom.selectSingleNode("/my:myFields/my:DatesSelectedByUser/my:dates");
dates .text = e.NewValue.ToString();
thisXDocument.DOM.selectSingleNode("/my:myFields/my:DatesSelectedByUser").appendChild(dates);
}