This question is locked. New answers and comments are not allowed.
I am creating an exported Excel file from a RadGRidView via the ToHtml() method. However, some of the columns are missing data. Below is an example of two columns from the grid. The first (Description) results in valid data. The second (Coupon) has no data in the resultant Excel column:
<telerikGV:GridViewDataColumn UniqueName="Description" IsReadOnly="True" Header="Description" Width="200">
<telerikGV:GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<uc1:NextFocusTextBox Text="{Binding Path=Description}" IsReadOnly="True" Background="White" Height="22" />
</Grid>
</DataTemplate>
</telerikGV:GridViewColumn.CellTemplate>
</telerikGV:GridViewDataColumn>
<telerikGV:GridViewDataColumn UniqueName="Coupon" IsReadOnly="True" Header="Coupon (%/yr)" Width="95">
<telerikGV:GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<uc1:NextFocusTextBox Text="{Binding Path=Bond.Coupon, Converter={StaticResource ValueConverterNumericDash}, ConverterParameter=0:N3}" BorderThickness="0" IsReadOnly="True" IsEnabled="{Binding IsEnabled}" />
</Grid>
</DataTemplate>
</telerikGV:GridViewColumn.CellTemplate>
</telerikGV:GridViewDataColumn>
The code behind to produce the results is:
private void mbToolBar_ExcelExportClicked(object sender, EventArgs e)
{
_printFileName = "some_location" + MainPage.Username + ".xls";
Uri uri = new Uri(_wcf.InnerChannel.Via.AbsoluteUri.Replace(_wcf.InnerChannel.Via.AbsolutePath, "/PrintHandler.aspx?FileName=" + _printFileName));
WebClient client = new WebClient();
client.UploadStringCompleted += new UploadStringCompletedEventHandler(client_UploadExcelCompleted);
client.UploadStringAsync(uri, BondGrid.ToHtml());
BondGrid.IsBusy = true;
}
<telerikGV:GridViewDataColumn UniqueName="Description" IsReadOnly="True" Header="Description" Width="200">
<telerikGV:GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<uc1:NextFocusTextBox Text="{Binding Path=Description}" IsReadOnly="True" Background="White" Height="22" />
</Grid>
</DataTemplate>
</telerikGV:GridViewColumn.CellTemplate>
</telerikGV:GridViewDataColumn>
<telerikGV:GridViewDataColumn UniqueName="Coupon" IsReadOnly="True" Header="Coupon (%/yr)" Width="95">
<telerikGV:GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<uc1:NextFocusTextBox Text="{Binding Path=Bond.Coupon, Converter={StaticResource ValueConverterNumericDash}, ConverterParameter=0:N3}" BorderThickness="0" IsReadOnly="True" IsEnabled="{Binding IsEnabled}" />
</Grid>
</DataTemplate>
</telerikGV:GridViewColumn.CellTemplate>
</telerikGV:GridViewDataColumn>
The code behind to produce the results is:
private void mbToolBar_ExcelExportClicked(object sender, EventArgs e)
{
_printFileName = "some_location" + MainPage.Username + ".xls";
Uri uri = new Uri(_wcf.InnerChannel.Via.AbsoluteUri.Replace(_wcf.InnerChannel.Via.AbsolutePath, "/PrintHandler.aspx?FileName=" + _printFileName));
WebClient client = new WebClient();
client.UploadStringCompleted += new UploadStringCompletedEventHandler(client_UploadExcelCompleted);
client.UploadStringAsync(uri, BondGrid.ToHtml());
BondGrid.IsBusy = true;
}