Group: StrataFrame Users
Posts: 77,
Visits: 470
|
I am calling a browse dialog from a button on a standard form, I am filling the search criteria and calling the browse dialog. The dialog comes up with the expected results selected and when I click any where on the browse dialog for the first time I get the following message:
ArgumentException An item with the same key has already been added.
Source : mscorlib
Stack Trace: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.HandleSearchValueChanged(Control sourceControl, SearchFieldItem sourceFieldItem) at MicroFour.StrataFrame.UI.Windows.Forms.BrowseDialogwindow.HandleValidated(Object sender, EventArgs e) at System.Windows.Forms.Control.OnValidated(EventArgs e) at System.Windows.Forms.Control.PerformControlValidation(Boolean bulkValidation)
If I close the message everything works as expected and the result is returned as expected and no more messages. In the click event of the calling form I have the following code:
private void button1_Click(object sender, EventArgs e)
{
this.browseDialog1.AdvancedOptions = false;
this.browseDialog1.AllowHideResults = false;
this.browseDialog1.AllowSearchFieldsButton = false;
this.browseDialog1.SearchFields[0].InitialValue = comboBoxCarrier.Text.Trim();
this.browseDialog1.SearchFields[1].InitialValue = comboBoxCust.Text.Trim();
this.browseDialog1.SearchFields[2].InitialValue = comboBox1.Text.Trim();
this.browseDialog1.SearchFields[3].InitialValue = dateTimePickerBegin.Value.ToShortDateString();
this.browseDialog1.SearchFields[4].InitialValue = dateTimePickerEnd.Value.ToShortDateString();
this.browseDialog1.SearchFields[5].InitialValue = "";
this.browseDialog1.SearchFields[6].InitialValue = "";
if (this.browseDialog1.ShowDialog(true).Equals(DialogResult.OK))
{
listView1.Requery();
}
}
Any thoughts?
|