This is a migrated thread and some comments may be shown as answers.

exporter_ExcelCellFormatting

1 Answer 178 Views
GridView
This is a migrated thread and some comments may be shown as answers.
JustinWong
Top achievements
Rank 1
JustinWong asked on 03 May 2010, 05:12 AM

Hi:

Can you give an example on how to use exporter_ExcelCellFormatting even?  The example given in:

http://www.telerik.com/help/winforms/export-excel.html

is NOT helpful. It shows the Sub exporter_ExcelCellFormatting(ByVal sender as object, ByVal e As . . . ). That's great, but how exactly do you call this even, what do you pass as the sender and what do you pass as the argument when a person is call this routine? 

Generally, I find that many of your examples are 'half-cooked.'  It shows part of a set of code, but often do not show, from start to finish, exactly how that set of codes should be used.  A COMPLETE USAGE example within real context would be appreciated!

Justin

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 05 May 2010, 08:11 PM
Hi JustinWong,

Thank you for writing.

In order to use the ExportToExcelML events you have to firstly subscribe to them. Please, consider the following code:
 
Private Sub radButtonExport_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim dialog As New SaveFileDialog()
    If dialog.ShowDialog() = DialogResult.OK Then
        Dim exporter As New ExportToExcelML(Me.radGridView1)
        exporter.ExportVisualSettings = True
          
        AddHandler exporter.ExcelCellFormatting, AddressOf exporter_ExcelCellFormatting
        AddHandler exporter.ExcelTableCreated, AddressOf exporter_ExcelTableCreated
          
        exporter.RunExport(dialog.FileName)
          
        MessageBox.Show("Export finished")
    End If
End Sub
  
Private Sub exporter_ExcelTableCreated(ByVal sender As Object, ByVal e As ExcelTableCreatedEventArgs)
      
End Sub
  
Private Sub exporter_ExcelCellFormatting(ByVal sender As Object, ByVal e As ExcelCellFormattingEventArgs)
    e.ExcelStyleElement.InteriorStyle.Color = Color.Orange
End Sub

Thank you for your feedback regarding our help documentation. We are constantly working to improve it and recently we have updated the exporting section. We will consider your notes for future updates.

I just want to remind you that besides our help documentation, you could find useful our other support resources, such as the Step-By-Step Courseware, Knowledge Base and Code Library. If you cannot find there what you are looking for, do not hesitate to use our support system. We are happy to help with any questions regarding our products.


Kind regards,
Martin Vasilev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
JustinWong
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or