SelectedIndexChanged strange behaviour
Posted: Tue Aug 17, 2010 4:46 am
Hi all,
i am getting stuck to work out a strange feature ,i have 2 ChekedListBox and 1 TextBoxControl: CheckedListBoxControl1 (it's populate by a list of cities) and CheckedListBoxControl3 (it's populate by a list of Excursion Services refering to the cities checked in the CheckedListBoxControl1 ) and TextBoxControl6 should display the item selected by the CheckedListBoxControl3 ;
In the event "SelectedIndexChanged " of the CheckedListBoxControl3 i have this code:
my purpose is each time i select an item in the CheckedListBoxControl3 the TextBoxControl6 will display a description of that record ;
but there is a strange behaviour i have 12 Items in CheckedListBoxControl3 so if i select ir order ascending (from item 0 to item 12) the TextBoxControl6 can display the record instead if i select from (item 12 to item 0) the TextBoxControl6 caould't display anything.
Why i get this strange behaviour?Can you correct me if i wrong something in the code?
Thanks so much .
Have a good day.
Cheers
i am getting stuck to work out a strange feature ,i have 2 ChekedListBox and 1 TextBoxControl: CheckedListBoxControl1 (it's populate by a list of cities) and CheckedListBoxControl3 (it's populate by a list of Excursion Services refering to the cities checked in the CheckedListBoxControl1 ) and TextBoxControl6 should display the item selected by the CheckedListBoxControl3 ;
In the event "SelectedIndexChanged " of the CheckedListBoxControl3 i have this code:
Code: Select all
TextBoxControl6.Text = "";
if (CheckedListBoxControl3.SelectedIndex >= 0)
{
for (int i=0;i<CheckedListBoxControl1.Control.CheckedItems.Count;i++)
{
string vari = CheckedListBoxControl1.Control.CheckedItems[i].ToString();
Excursion_TBL.First();
while (!Excursion_TBL.IsEof)
{
for (int j=0; j<CheckedListBoxControl3.Control.CheckedItems.Count; j++)
{
string record = CheckedListBoxControl3.Control.CheckedItems[j].ToString();
if (Excursion_TBL.CityCode == vari && Excursion_TBL.CodeExcursionID == record)
{
TextBoxControl6.Text =Excursion_TBL.EnglishDescription1.ToString();
}
}
Excursion_TBL.Next();
}
}
}
but there is a strange behaviour i have 12 Items in CheckedListBoxControl3 so if i select ir order ascending (from item 0 to item 12) the TextBoxControl6 can display the record instead if i select from (item 12 to item 0) the TextBoxControl6 caould't display anything.
Why i get this strange behaviour?Can you correct me if i wrong something in the code?
Thanks so much .
Have a good day.
Cheers