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);
}
}
Loading
Suthish NairPosted Jan 30, 2011, 5:24 AM
Response.Write(Convert.ToDateTime("2010-12-18T12:00:00").ToString("dd-MMMM-yyyy"));Response.Write("
");
Response.Write(Convert.ToDateTime("2010-12-18T12:00:00").ToString("dd-MM-yyyy"));
Suthish NairPosted Jan 30, 2011, 1:37 PM
So other members can easily find the answers.
Daniel GolanPosted Jan 30, 2011, 5:14 AM
Suthish NairPosted Jan 30, 2011, 5:09 AM
Response.Write("2010-12-18T12:00:00".Replace("T", " "));Daniel GolanPosted Jan 30, 2011, 4:53 AM
Suthish NairPosted Jan 30, 2011, 4:43 AM