WebGrid - Export to XML not working

5 replies. Last post: November 17, 2014 2:18 AM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

I am getting an error when exporting a web grid to XML. The error message is "Cannot change the name of the DataSet to an empty string."

I tried setting the data source as datatable and dataset. Both give same error. Pls help!

Code Snippet below..

Web Grid Definition -

 <ISWebGrid:WebGrid ID="WebGrid1" runat="server" AllowAutoDataCaching="True" Visible="false" DataMember="CarrierList" Height="430px" UseDefaultStyle="True" Width="100%" OnExport="WebGrid1_Export" OnExportCompleted="WebGrid1_ExportCompleted" OnPrepareExportExecute="WebGrid1_PrepareExportExecute" OnInitializePostBack="WebGrid1_InitializePostBack" OnInitializeRow="WebGrid1_InitializeRow" OnInitializeDataSource="WebGrid1_InitializeDataSource" >
<RootTable DataKeyField="Oid" GroupMode="Collapsed" DataMember="CarrierList" Caption="CarrierList">
<Columns>
...
...
</Columns>
 </RootTable>
<LayoutSettings  AllowColumnMove="Yes" AllowExport="Yes" AllowGrouping="No" AllowSelectColumns="Yes" AllowFilter="Yes" AllowSorting="Yes" ApplyFiltersKey="Enter" AutoFilterSuggestion="true" PagingMode="VirtualLoad" RowChangedAction="none" AlwaysShowHelpButton="False" RowHighlightType="EntireRow" InProgressUIBehavior="ChangeCursorToHourGlass" ShowFilterStatus="True" CellClickAction="rowSelect" FilterBarVisible="False">
<FreezePaneSettings ShowInContextMenu="True" MaxFrozenColumns="2" />
<GroupByBox ContextMenu="false">
</GroupByBox>
<ClientSideEvents OnRowContextMenu="WebGrid1_OnRowContextMenu"/>
</LayoutSettings>
</ISWebGrid:WebGrid>

Data Source -

 try
{
   DataSet ds = new DataSet("CarrierList");                
   ds.Tables.Add(_dt);
   e.DataSource = ds;
}

All times are GMT -5. The time now is 10:30 PM.
Previous Next