Export only specific records

4 posts, 0 answers
  1. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 08 Dec 2011 Link to this post

    I have a rad grid with a grid template column of checkboxes. Some are checked and some aren't, I do that in the code behind on the item data bound event. I have a button to export to excel but I need to export only the rows that aren't checked. I really don't even know where to start to do this. What would be the best way to go about this? Here's how I'm exporting right now.

    Protected Sub export_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles export.Click
         RadGrid1.ExportSettings.OpenInNewWindow = True
         RadGrid1.ExportSettings.ExportOnlyData = True
         RadGrid1.ExportSettings.IgnorePaging = True
         RadGrid1.MasterTableView.ExportToExcel()
     End Sub
  2. Pablo
    Pablo avatar
    10 posts
    Member since:
    Oct 2012

    Posted 08 Dec 2011 Link to this post

    If you filter your records (using the column filter in the checkbox column) and then export them to excel/pdf you would get the desire result 
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 12 Dec 2011 Link to this post

    I can't go that route, as I have to have a custom check box in there. Is there a way to loop through the columns on export and see if a specific item is checked and say "don't export this row"?
  5. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 12 Dec 2011 Link to this post

    I ended up just creating another grid on the page but set visible to false and then databound that on the export click and then used that for my data. Probably not ideal, but it works.
Back to Top