Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
Worksheet row count?
posted

Hi,

 

i have been trying to get row count on the worksheet so that i can add a row at the end and include few details.

 if it were a FLAT grid then i get the row count from grid rows, but i have Hierachical and users can also select OutLookgroupby feature.

 here i am struggling to get the last row of the worksheet.

UltraWebGridExcelExporter1.Export(Ultrawebgrid1, WorkSheet, 5, 0)

 can anyone tell how to get the row count of the worksheet?

 Note: i tried WorkSheet.Rows.Count; its private readonly property i can't access it.

 thank you,

Parents
No Data
Reply
  • 4960
    posted

    Handle the WebGridExcelExporter's RowExported event and keep the maximum e.RowIndex you see around in a member variable; when the export is finished that will be the number of WorksheetRows.

    The WorksheetRowsCollection always assumes there can be 65,536 WorksheetRows in itself, so the first time you ask for row number 65,000 it will create a WorksheetRow object on demand, so the count of actual WorksheetRow instances maintained internally won't help you find them by indexing, as in a for-loop.

Children