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

Write to Log Every Time RadGrid is Exported Sitewide

2 Answers 8 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 13 Nov 2013, 10:28 PM
Subject says it all, I want to call a method that will write a log entry any time a user exports a RadGrid to Excel.  I am currently using the 

GridExporting event in the code behind of each ASPX page and it works fine. What I am looking to do is set up something more global, such that if any grid is ever exported, add the log entry. It may be more of a general .net overloading/inheritance question but figured I would start here.  

2 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 18 Nov 2013, 11:13 AM
Hi Nicholas,

A possible solution is to create a user control which inherited the RadGrid and can extend its functionality. This way you will be able to add a method which write a log when exporting the grid.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Nick
Top achievements
Rank 1
answered on 18 Nov 2013, 11:46 AM
Thanks,  I already implemented using this override method , without the need to declare/define the .ascx.

Namespace Controls
    Public Class NCGrid
        Inherits RadGrid
 
        Protected Overrides Sub OnGridExporting(e As GridExportingArgs)
            MyBase.OnGridExporting(e)
            SPInsertAuditLog("GridExport", String.Format("{0} rows", Me.Items.Count.ToString()))
        End Sub
 
    End Class
 
End Namespace

Tags
Grid
Asked by
Nick
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Nick
Top achievements
Rank 1
Share this question
or