Hi
I am very new to Infragistics controls.I am using XmlNodeList as my Datasource for UltraWebGrid . Though I can see my entire Data in the Datasource List (during debug) , am not able to bind the data to my grid. Can somebody pls help me. Its urgent .... Thanks in advance. Part of the code is as below .....
XmlNodeList nodes = null;
{
this.UltraWebGrid1.DataBind();
}
try
if (xmlout != null)
return nodes;
else
finally
uSession.Dispose();
The part of XML generated is as below ...
<ROOT><STOCK> <_ID>6651134</_ID> <CSCI/> <STCPIDATE>01/01/1968</STCPIDATE> <STEXCSEC/> <STAMNDDATE/></STOCK><STOCK> <_ID>0056489</_ID> <CSCI>RES</CSCI> <STCPIDATE/> <STEXCSEC>021</STEXCSEC> <STAMNDDATE>04/04/2008</STAMNDDATE></STOCK><STOCK>
The UltraWebGrid Columns are as below :
<igtbl:TemplatedColumn BaseColumnName="CSCI" HeaderClickAction="SortSingle" IsBound="True"
Key="CSCI" NullText="AB">
<CellTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# ((System.Xml.XmlNode)(Container.DataItem))["CSCI"].InnerText %>'></asp:Label>
</CellTemplate>
<Header Caption="CSCI" ClickAction="SortSingle">
</Header>
<ValueList DataMember="CSCI" DisplayStyle="DataValue" Key="CSCI">
</ValueList>
</igtbl:TemplatedColumn>
<igtbl:TemplatedColumn BaseColumnName="STCPIDATE" IsBound="True" Key="STCPIDATE"
NullText="AB">
<asp:Label ID="Label2" runat="server" Text='<%# ((System.Xml.XmlNode)(Container.DataItem))["STCPIDATE"].InnerText %>'></asp:Label>
<Header Caption="STCPIDATE">
<RowLayoutColumnInfo OriginX="1" />
<Footer>
</Footer>
<ValueList DataMember="STCPIDATE" DisplayStyle="DataValue" Key="STCPIDATE">
<igtbl:TemplatedColumn BaseColumnName="STEXCSEC" DataType="System.Int32" IsBound="True"
Key="STEXCSEC" NullText="12">
<asp:Label ID="Label3" runat="server" Text='<%# ((System.Xml.XmlNode)(Container.DataItem))["STEXCSEC"].InnerText %>'></asp:Label>
<Header Caption="STEXCSEC">
<RowLayoutColumnInfo OriginX="2" />
<ValueList DataMember="STEXCSEC" DisplayStyle="DataValue" Key="STEXCSEC">
<igtbl:TemplatedColumn BaseColumnName="STAMNDDATE" IsBound="True" Key="STAMNDDATE"
<asp:Label ID="Label4" runat="server" Text='<%# ((System.Xml.XmlNode)(Container.DataItem))["STAMNDDATE"].InnerText %>'></asp:Label>
<Header Caption="STAMNDDATE">
<RowLayoutColumnInfo OriginX="3" />
<ValueList DataMember="STAMNDDATE" DisplayStyle="DataValue" Key="STAMNDDATE">
</Columns>
Hello,
Thanks for writing and for your interest in our products. I believe the easiest way to bind XML to the UltraWebGrid is to read the XML into DataSet, and then bind it to grid. It is just a couple of line of code - here is a sample approach
string xmlString = @" <ROOT> <STOCK> <_ID>6651134</_ID> <CSCI/> <STCPIDATE>01/01/1968</STCPIDATE> <STEXCSEC/> <STAMNDDATE/> </STOCK> <STOCK> <_ID>0056489</_ID> <CSCI>RES</CSCI> <STCPIDATE/> <STEXCSEC>021</STEXCSEC> <STAMNDDATE>04/04/2008</STAMNDDATE> </STOCK> </ROOT>"; DataSet ds = new DataSet(); StringReader sr = new StringReader(xmlString); ds.ReadXml(sr); UltraWebGrid1.DataSource = ds; UltraWebGrid1.DataBind();
Hope this helps.
It looks good. but if xmlString has huge data then application performance will be reduce. Is there any other alternative for that?
Having that smae set of code, doesn't work for me.
First time I get no data error then data displays..
Dim ds As DataSet ds = PerformSearch() wdgPeople.DataSource = ds wdgPeople.DataBind()