Dec 10, 2008, 5:41 AM
Remove Combo Box Item
hi,
i have loaded items in ComoBox at page Loading time..the code is
ds3.ReadXml(MapPath("xml/CAPTION/General_Caption.xml"));
string select1 = ds3.Tables["C_Select"].Rows[0][Convert.ToString(LStrlang)].ToString();
DataSet fname = new DataSet();
fname.ReadXml(MapPath("xml/Filter_path_name.xml"));
string xmlDoc = fname.Tables[0].Rows[0][0].ToString();
if (!Directory.Exists(xmlDoc))
{
System.IO.Directory.CreateDirectory(xmlDoc);
}
String[] Filenames = Directory.GetFiles(xmlDoc, "*.xml");
foreach (String filename in Filenames)
{
string xmlname = "";
if (File.Exists(filename))
{
String basename = Path.GetFileName(filename);
string[] Split = basename.Split(new Char[] { '_' });
string s = Split[0].ToString();
string s1 = Split[1].ToString();
string xname = Split[2].ToString();
string[] Split1 = xname.Split(new Char[] { '.' });
xmlname = Split1[0].ToString();
string s2 = Split1[1].ToString();
if (s1 == "public")
{
xmlname = "(" + xmlname + ")";
Coolite.Ext.Web.ListItem ll = new Coolite.Ext.Web.ListItem();
ll.Text = xmlname.ToString();
cmb_selectFilters.Items.Add(ll);
}
else
{
string email = Session["user"].ToString();
string[] Split11 = email.Split(new Char[] { '@' });
string name = Split11[0].ToString();
if (s1 == name)
{
Coolite.Ext.Web.ListItem ll = new Coolite.Ext.Web.ListItem();
ll.Text = xmlname.ToString();
cmb_selectFilters.Items.Add(ll);
}
}
}
}
Coolite.Ext.Web.ListItem first = new Coolite.Ext.Web.ListItem();
first.Text = select1.ToString();
cmb_selectFilters.EmptyText = select1;
then i want to remove selecteditem form comboBox on button click event.But i cant remove selectedItem..how i can do this?.help me.
by
SpeedStep
i have loaded items in ComoBox at page Loading time..the code is
ds3.ReadXml(MapPath("xml/CAPTION/General_Caption.xml"));
string select1 = ds3.Tables["C_Select"].Rows[0][Convert.ToString(LStrlang)].ToString();
DataSet fname = new DataSet();
fname.ReadXml(MapPath("xml/Filter_path_name.xml"));
string xmlDoc = fname.Tables[0].Rows[0][0].ToString();
if (!Directory.Exists(xmlDoc))
{
System.IO.Directory.CreateDirectory(xmlDoc);
}
String[] Filenames = Directory.GetFiles(xmlDoc, "*.xml");
foreach (String filename in Filenames)
{
string xmlname = "";
if (File.Exists(filename))
{
String basename = Path.GetFileName(filename);
string[] Split = basename.Split(new Char[] { '_' });
string s = Split[0].ToString();
string s1 = Split[1].ToString();
string xname = Split[2].ToString();
string[] Split1 = xname.Split(new Char[] { '.' });
xmlname = Split1[0].ToString();
string s2 = Split1[1].ToString();
if (s1 == "public")
{
xmlname = "(" + xmlname + ")";
Coolite.Ext.Web.ListItem ll = new Coolite.Ext.Web.ListItem();
ll.Text = xmlname.ToString();
cmb_selectFilters.Items.Add(ll);
}
else
{
string email = Session["user"].ToString();
string[] Split11 = email.Split(new Char[] { '@' });
string name = Split11[0].ToString();
if (s1 == name)
{
Coolite.Ext.Web.ListItem ll = new Coolite.Ext.Web.ListItem();
ll.Text = xmlname.ToString();
cmb_selectFilters.Items.Add(ll);
}
}
}
}
Coolite.Ext.Web.ListItem first = new Coolite.Ext.Web.ListItem();
first.Text = select1.ToString();
cmb_selectFilters.EmptyText = select1;
then i want to remove selecteditem form comboBox on button click event.But i cant remove selectedItem..how i can do this?.help me.
by
SpeedStep