Results 1 to 2 of 2

Thread: tool strip button to export from Search grid throws exception

Hybrid View

  1. #1

    Thread Starter
    Member
    Join Date
    May 2018
    Posts
    41

    tool strip button to export from Search grid throws exception

    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

  2. #2

    Thread Starter
    Member
    Join Date
    May 2018
    Posts
    41

    Re: tool strip button to export from Search grid throws exception

    I fixed it. Calling wrong grid...needed to call the search results

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width