Dear Friends,
I would Like to one thing about The Reloading one value in Combobox Control.
Here i Show the What i really Expect ..
CountryName
India
The above value to be reloaded from the Db, to the comboCountry Id ...
1. cmobox.selecteditem.Text=_dt.Rows[0]["COUNTRY"].ToString();
2. ddlCountry.SelectedIndex =ddlCountry.Items.IndexOf(ddlCountry.Items.FindByText(_dt.Rows[0]["Country"].ToString().Trim()));
The above coding not working , In If not ispostback section , i have loaded on the County Comboboxxx..
Those above two not woking ..too
Thanks in Advance

Iftikar HussainPosted Aug 2, 2013, 7:28 AM
I believe you are setting the selected item for the country combo after binding the details. you can set like this
string selectedCountry=_dt.Rows[0]["COUNTRY"].ToString();
ddlCountry.SelectedIndex = ddlCountry.Items.IndexOf(ddlCountry.Items.FindByValue(selectedCountry));
or
ddlCountry.SelectedIndex = ddlCountry.Items.IndexOf(ddlCountry.Items.FindByText(selectedCountry));
Regards,
Iftikar