Hi,
I have added a toolstrip button to export the search grid, but it fails on the Tablestyle property.
On click of button,
Code:
Dim frm as New frmDtaGridExcelExport
Dim tbl as Datatable
tbl = dgsearchGrid.datasource
With frm
.formLoad(tbl, Me)
.ShopwDialog()
.Dispose
Public Class frmDataGridExcelExport
Public msPath As String
Public mbCancel As Boolean 'True if user did not close form with the export button
Public dt As DataTable
Public dg As Object
Dim miRowCount As Integer
Dim miColCount As Integer
Dim msFileName As String = ""
FormLOad(ByVal dtable as DataTable, ByVAl dgrid As Object) As Boolean)
dt = dtable
dg = dgrid
mbCancel = True
miRowCount = dt.Rows.Count
if dg iS Nothing Then
miColcount = dt.Columns.Count
Else
miColcount = dg.TAbleStyles(dg.TAbleStyles.Count - 1).GridColumnStyles.Count
****Exception here*****
An unhandled exception of type 'System.MissingMemberException' occurred in Microsoft.VisualBasic.dll
Additional information: Public member 'TableStyles' on type 'frmCaseDetails' not found.
I tried making the
Private Sub Size_SearchGrid() to Public , but no effect, where it has definitions and
Code:
Private Sub Size_SearchGrid()
dgSearchGrid.TableStyles.Clear()
dgSearchGrid.TableStyles.Add(dgts)
SizeColumnsV2(dgts, dgSearchGrid, 20, 18)
dgSearchGrid.ReadOnly = True