Dear all
How can can write the datas in the grid to a XML file.Is there any function provided by inftragistics
or
is it possible to assign the datsource of a grid to a dataset so that i can use the "writexml()" function of the dataset to get the xml
fiessystems said:How can can write the datas in the grid to a XML file.Is there any function provided by inftragistics
No, the grid has no built-in XML export functionality.
fiessystems said:is it possible to assign the datsource of a grid to a dataset so that i can use the "writexml()" function of the dataset to get the xml
You can set the DataSource of the grid to a DataSet or DataTable, of course. But if you are using some other data source, the grid cannot convert the data into a DataTable or DataSet for you, if that's what you mean.
Basically, you will need to loop through the grid rows and create the XML yourself.
Dear Mile,
I has assied a datset as datasource of the grid using the below statement
DataTable Quot_Details = new DataTable();
Quot_Details=ObjSupplyBL.GetbyIdSupplyquotationDetails(QuotationId, CompanyId, FinancialYearId); if (Quot_Details.Rows.Count > 0) { ultraGridQuotationSummary.DataSource = Quot_Details; ultraGridQuotationSummary.DataBind(); }
is it possible for me to reassign the datasource of the grid to a datasat or a table?
I had use the below code to accomplish the same (maked the reassignment statements in bold),but when running the code i found the datasource becomming null.
is there any soution for this so that i can get the xml file from the datasource of the grid by assigning it to a dataset.
private void GetValues(Control pParent) { foreach (Control ctrl in pParent.Controls) { GetValues(ctrl);
if (ctrl is Infragistics.WebUI.UltraWebGrid.UltraWebGrid) { Infragistics.WebUI.UltraWebGrid.UltraWebGrid ugGrid = new Infragistics.WebUI.UltraWebGrid.UltraWebGrid(); ugGrid = (Infragistics.WebUI.UltraWebGrid.UltraWebGrid)ctrl;
DataSet ds = new DataSet(); ds = (DataSet)ugGrid.DataSource;
if (ds != null) { dsControlValues.Tables["ControlValues"].Rows.Add(); dsControlValues.Tables["ControlValues"].Rows[dsControlValues.Tables["ControlValues"].Rows.Count - 1]["ControlName"] = ugGrid.ID.ToString(); dsControlValues.Tables["ControlValues"].Rows[dsControlValues.Tables["ControlValues"].Rows.Count - 1]["ControlValue"] = ds.GetXml(); } }
}
Regards
Rajesh Kamalakshan