Hello,
How can i split items in a combobox ?
using the code to populate the combo and wondering how i could modify the code to split the added item at "T" since i only need the first part of the attribute :
private void populateCombo_dato()
{
cmb_dato.Items.Clear();
//åpner xml
XDocument xmlDoc = XDocument.Load(lab_url.Text);
//leser attributt fra bestemt setd
var xmlAtt = from att in xmlDoc.Elements("weatherdata").Elements("forecast").Elements("tabular").Elements("time").Attributes("from")
select att;
//loop og legg de i listen om de ikke finnes
foreach (var record in xmlAtt)
{
if (!cmb_dato.Items.Contains(record.Value)) ;
cmb_dato.Items.Add(record.Value);
}
}
Splitting values in a combobox
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Suthish NairRank #93 · 22.6K pointsPosted Jan 30, 2011, 12:24 AM EST
Daniel Golan26 pointsPosted Jan 29, 2011, 11:53 PM EST
Suthish NairRank #93 · 22.6K pointsPosted Jan 30, 2011, 12:09 AM EST
Daniel Golan26 pointsPosted Jan 30, 2011, 12:14 AM EST
Suthish NairRank #93 · 22.6K pointsPosted Jan 30, 2011, 8:37 AM EST
So other members can easily find the answers.
1 short reply
Suthish NairRank #93 · 22.6K pointsPosted Jan 29, 2011, 11:43 PM EST