Bonjour,
J'essaye recuperer et d'afficher le contenu de mon XML dans une datalist.
Pour ce qui est de la recuperation tout marche bien.
Je reussi a creer mes colonnes et a y inserer mes donnees contenues dans le XML.
Mais l'affichage ne fonctionne pas
Avez vous une idee?
Merci
public
void DispayXmlFile() {
DataList DataList1 =
newDataList();
DataList1.DataSource = GetDataSource();
DataList1.DataBind(); pas d'affichage sur ma page}
ICollection GetDataSource()
{
XmlPortfolioUpdate.Load(PathXML);
DataTable dtInstrument = newDataTable();
DataRow drInstrument;
for (int i = 0; i < NodeName.Length; i++)
{
dtInstrument.Columns.Add(newDataColumn(NodeName[i].ToString(), typeof(string)));
}
XmlNodeList objChildNode = XmlPortfolioUpdate.GetElementsByTagName("Position");
foreach (XmlNode objNode in objChildNode)
{
drInstrument = dtInstrument.NewRow();
for (int i = 0; i < NodeName.Length; i++)
{
drInstrument[i] = objNode.ChildNodes[i].InnerText;
}
dtInstrument.Rows.Add(drInstrument);
}
DataView dvInstrument = newDataView(dtInstrument);
return dvInstrument;// ici j'ai bien ma mes donnees dans ma Table
}