Hi Scott,
This can be done by setting a datasource for the autocomplete datasource having multicolumns one column as the unique key of the Patient and another as the Patient Name. Using this relation we can get the unique identity of the patient. Here is the code for setting datasource with multiple column
for (int i = 0; i < 10; ++i)
{
DataRow dr = dt.NewRow();
dr[0] = "Patient"+ i.ToString();
dr[1] = RandomString(ran.Next(9));
dt.Rows.Add(dr);
}
this.autoComplete1.DataSource = dt;
this.autoComplete1.RefreshColumns();
this.autoComplete1.Columns[1].MatchingColumn = true;
this.autoComplete1.Columns[0].Visible = false;
and the Autocomplete item selection event can be used to identify the unique id of the patient. Here is the code for it,
private void autoComplete1_AutoCompleteItemSelected(object sender, Syncfusion.Windows.Forms.Tools.AutoCompleteItemEventArgs args)
{
if (this.autoComplete1.SelectedIndex >=0)
{
Console.WriteLine(dt.Rows[this.autoComplete1.SelectedIndex][0].ToString());
}
}
Here is the sample for your reference,
Sample:
http://websamples.syncfusion.com/samples/Tools.Windows/F66784/main.htmKindly take a look and let me know if this helps.
Regards,
Ajish.