G
gh
Hi,
I created a class that has three string members, ShortCut,
ClientCode and ClientName. I used a ArrayList to store the class instances
and binded these fields to a 3 combo boxes with the following code.
this.orderTicket1.CboClientSC.DisplayMember="Shortcut";
this.orderTicket1.CboClientSC.ValueMember="Code";
this.orderTicket1.CboClientSC.DataSource=this.shortcutList;
this.orderTicket1.CboClientCode.DisplayMember="Code";
this.orderTicket1.CboClientCode.ValueMember="Code";
this.orderTicket1.CboClientCode.DataSource=this.clientCodeList;
this.orderTicket1.CboClientName.DisplayMember="EnglishName";
this.orderTicket1.CboClientName.ValueMember="Code";
this.orderTicket1.CboClientName.DataSource=this.clientEngNameList;
I also added some interactions among these controls such that once I
changed one of combo boxes, the other boxes can changed accordingly. I
captured event SelectedValueChanged of three controls, and when I tried to
change the combox control of the ClientCode, it threw a stack overflow
exception. The below code that deals with the combo box changes after I
capture the SelectedValueChanged event,
if(currSelectClient.Shortcut!=null)
{
this.orderTicket1.CboClientSC.SelectedItem=currSelectClient.Shortcut;
}
else
{
this.orderTicket1.CboClientSC.SelectedIndex=0;
}
if(currSelectClient.Code!=null)
{
this.orderTicket1.CboClientCode.SelectedItem=currSelectClient.Code;
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//this causes the stackoverflowexception
}
else
{
this.orderTicket1.CboClientCode.SelectedIndex=0;
}
if(currSelectClient.EnglishName!=null)
{
this.orderTicket1.CboClientName.SelectedItem=currSelectClient.EnglishName;
}
else
{
this.orderTicket1.CboClientName.SelectedIndex=0;
}
I created a class that has three string members, ShortCut,
ClientCode and ClientName. I used a ArrayList to store the class instances
and binded these fields to a 3 combo boxes with the following code.
this.orderTicket1.CboClientSC.DisplayMember="Shortcut";
this.orderTicket1.CboClientSC.ValueMember="Code";
this.orderTicket1.CboClientSC.DataSource=this.shortcutList;
this.orderTicket1.CboClientCode.DisplayMember="Code";
this.orderTicket1.CboClientCode.ValueMember="Code";
this.orderTicket1.CboClientCode.DataSource=this.clientCodeList;
this.orderTicket1.CboClientName.DisplayMember="EnglishName";
this.orderTicket1.CboClientName.ValueMember="Code";
this.orderTicket1.CboClientName.DataSource=this.clientEngNameList;
I also added some interactions among these controls such that once I
changed one of combo boxes, the other boxes can changed accordingly. I
captured event SelectedValueChanged of three controls, and when I tried to
change the combox control of the ClientCode, it threw a stack overflow
exception. The below code that deals with the combo box changes after I
capture the SelectedValueChanged event,
if(currSelectClient.Shortcut!=null)
{
this.orderTicket1.CboClientSC.SelectedItem=currSelectClient.Shortcut;
}
else
{
this.orderTicket1.CboClientSC.SelectedIndex=0;
}
if(currSelectClient.Code!=null)
{
this.orderTicket1.CboClientCode.SelectedItem=currSelectClient.Code;
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//this causes the stackoverflowexception
}
else
{
this.orderTicket1.CboClientCode.SelectedIndex=0;
}
if(currSelectClient.EnglishName!=null)
{
this.orderTicket1.CboClientName.SelectedItem=currSelectClient.EnglishName;
}
else
{
this.orderTicket1.CboClientName.SelectedIndex=0;
}