Hi,
I have a grid control which has some data. I want to export to data to excelML. I have read your demo (http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/exporting/defaultcs.aspx) and applied it. But could not resolve a problem. When it enters the function:
It gives the error "index out of range". There e.Row.Cells.Count is always zero. But when i try to export it to just EXCEL there is no problem. Below is my Grid.
I am using LinqDataSource while populating the grid.
Regards.
I have a grid control which has some data. I want to export to data to excelML. I have read your demo (http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/exporting/defaultcs.aspx) and applied it. But could not resolve a problem. When it enters the function:
| protected void RadGridOrders_ExcelMLExportRowCreated(object source, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e) |
| { |
| if (e.RowType == Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowType.DataRow) |
| { |
| if (e.Row.Cells[0] != null && ((string)e.Row.Cells[0].Data.DataItem).Contains("U")) |
| { |
| e.Row.Cells[0].StyleValue = "MyCustomStyle"; |
| } |
| } |
| } |
It gives the error "index out of range". There e.Row.Cells.Count is always zero. But when i try to export it to just EXCEL there is no problem. Below is my Grid.
| <telerik:RadGrid ID="RadGridOrders" runat="server" AllowPaging="True" |
| Width="95%" OnExcelMLExportStylesCreated="RadGridOrders_ExcelMLExportStylesCreated" |
| OnExcelMLExportRowCreated="RadGridOrders_ExcelMLExportRowCreated" |
| DataSourceID="DataSourceOrders" GridLines="None"> |
| <ExportSettings ExportOnlyData="True" FileName="SatışRaporları" |
| IgnorePaging="True"> |
| </ExportSettings> |
| <MasterTableView Width="100%" AutoGenerateColumns="False"> |
| <Columns> |
| <telerik:GridBoundColumn DataField="CalculatedCargoPrice" |
| DataType="System.Decimal" HeaderText="CalculatedCargoPrice" ReadOnly="True" |
| SortExpression="CalculatedCargoPrice" UniqueName="CalculatedCargoPrice"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="CalculatedItemPrice" |
| DataType="System.Decimal" HeaderText="CalculatedItemPrice" ReadOnly="True" |
| SortExpression="CalculatedItemPrice" UniqueName="CalculatedItemPrice"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="NameSurname" HeaderText="NameSurname" |
| ReadOnly="True" SortExpression="NameSurname" UniqueName="NameSurname"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
I am using LinqDataSource while populating the grid.
Regards.