Hi,
I've been attempting to implement the suggestions discussed in
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=450
and the discussion topic:
http://www.infopathdev.com/downloads/free/default.aspx?i=c56d9528ec4f4317a5bd469ac4e90b9d
However, I must be missing some key point. In Infopath, I have a Master/Detail. Also, I have a row number text box. When a user enters a row number and press the corresponding 'Goto' button, I want the Master record found at the give row number to be selected. This is very similar to the discussion topic written up by Greg Collins. My guess is that I'm using the wrong CtrlID. However, I'm not sure what else to try.
My code:
private string _patientChartCrtlID = "CTRL1_6";
private IXMLDOMNode _patientChartNodes = null;
[InfoPathEventHandler(MatchPath="CTRL110_6", EventType=InfoPathEventType.OnClick)]
public void CTRL110_6_OnClick(DocActionEvent e)
{
try
{
_patientChartNodes = thisXDocument.DOM.selectSingleNode("//Patient");
_patientChartNodes = thisXDocument.DOM.firstChild;
string newRow = thisXDocument.DOM.selectSingleNode("//my:Goto").text;
thisXDocument.SetNamedNodeProperty(_patientChartNodes, _patientChartCrtlID, newRow);
}
catch(System.Exception ex)
{
thisXDocument.UI.Alert(ex.ToString());
}
}
The line in the view.xsl file that I believe that I'm suppose to use to retrieve the CtrlID is:
<table class="xdRepeatingTable msoUcTable xdMaster" title="" style="TABLE-LAYOUT: fixed; WIDTH: 594px; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word; BORDER-BOTTOM-STYLE: none" border="1" xd:CtrlId="CTRL1_6" xd:masterID="CTRL1_6">
My XML tree is
Patient has many PatientCaseFiles
PatientCaseFile has many PatientCharts
Patient
PatientCaseFile
PatientChart
The list of Patients are displayed by the master the record and I'm trying to goto a specific Patient Row. The net effect of the code above is nothing happens. The current row selected is the same as it was prior to hitting the 'Goto' button.
Any help or in-sights would be much appreciated.
Thanks,
Mike M.