Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Grid > CSV Export exports mouse over text
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered CSV Export exports mouse over text

Feed from this thread
  • Mathew avatar

    Posted on Jun 22, 2011 (permalink)

    Hello,

    I have a radGrid that contains a cell with some mouse-over text.  When I export to CSV, that mouse-over text is included in the CSV file.  Is there are way to exclude or remove this mouse-over text from the CSV? 

    I'm considering putting code in the "RadGrid1_GridExporting" function (when ExportType is "ExportType.Csv") that would place the output first in a string[]...

     

        string[] lines = e.ExportOutput.Split('\n');

    Then, I'd would search each line for the mouse-over text (I can identify it by certain chars in the description), remove the text and then do a Replace on the output...

     

        e.ExportOutput = e.ExportOutput.Replace(oldLine, lines[0]);

    However, this doesn't seem like it'd be best practice.  Is there another way of doing it?

    Thanks,
    Matt

  • Posted on Jun 22, 2011 (permalink)

    Hello Mathew,

    You can use  ExportCellFormatting event which fires for each cell in each data item in RadGrid. ExportCellFormatting event is available since RadControls for ASP.NET AJAX Q1 2011. For older versions you can use ExcelExportCellFormatting .

    Check out the following documentation for more on this.
    Word/Excel export (HTML-based).

    Thanks,
    Shinu.

  • Mathew avatar

    Posted on Jun 27, 2011 (permalink)

    Hi Shinu,
    I played around with the ExportCellFormatting event and it (just like ExcelExportCellFormatting) seems to only fire when exporting to Excel.  So, I don't think I'll be able to use it for CSV export.  This below is my code.  When I click the Export To Excel button on the grid, then I can step into my "RadGrid1_ExportCellFormatting" function.  When I click Export To CSV, it bypasses it.  I'm using version 2011.1.519.35 of Telerik.Web.UI.dll.

     

    <telerik:RadGrid ID="RadGrid1" AllowSorting="True" OnExportCellFormatting="RadGrid1_ExportCellFormatting" 
    AllowPaging="True" PageSize="10" runat="server" GridLines="None" Width="400px"
    <ExportSettings OpenInNewWindow=true HideStructureColumns="true" /> 
    <MasterTableView Width="100%" CommandItemDisplay="Top"
    <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 
    <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true" 
    ShowExportToCsvButton="true" /> 
    </MasterTableView
    </telerik:RadGrid>
      
    protected void RadGrid1_ExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
    {
    }

  • Vasil Vasil admin's avatar

    Posted on Jun 28, 2011 (permalink)

    Hi Mathew,

    ExportCellFormating event is expected to fire when exporting to Word or Excel. The event will not fire when exporting for CSV.

    Kind regards,
    Vasil
    the Telerik team

    Consider using RadControls for ASP.NET AJAX (built on top of the ASP.NET AJAX framework) as a replacement for the Telerik ASP.NET Classic controls, See the product support lifecycle here.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Grid > CSV Export exports mouse over text