Amend column size on NominalGridLookup

SOLVED

Hi all,

I want to amend the grid inside a dropdown programmatically so the Name column is wide as soon at the form open.

But I am unable to get the grid inside it because its control is PopupTextBox+Dropdown which I cannot initiate in the code. Also the Dropdown class inside PopupTextBox is an internal class. 

Is there any way to do this?

Parents
  • 0

    Use the PopupOpened event - something like this:

    Public Class NominalPaymentReceiptForm
        'alter grid and popup columns
        Sub New(ByVal form As AmendableForm)
            Dim grid As Grid
            grid = CType(form.FindControlByName("nominalGrid").UnderlyingControl, Grid)
            grid.Columns(0).Width += 20
            grid.Columns(1).Width -= 10
            grid.Columns(2).Width -= 10
            grid.Columns(3).Width += 20
            grid.Columns(3).AutoSize = True
            Dim nominalGridLookup As Sage.MMS.Controls.NominalGridLookup
            nominalGridLookup = CType(form.FindControlByName("nominalGridLookup").UnderlyingControl, Sage.MMS.Controls.NominalGridLookup)
            AddHandler nominalGridLookup.PopupOpened, AddressOf NominalGridLookup_PopupOpened
        End Sub
        Private Sub NominalGridLookup_PopupOpened(ByVal sender As Object, ByVal args As Sage.Common.Controls.PopupOpenedEventArgs)
            If args.InvokeType = Sage.Common.Controls.InvokeType.Validate Then Exit Sub
            Dim list As List = CType(args.Form.Controls(0), List)
            list.Columns(0).Width = 70
            list.Columns(1).Width = 25
            list.Columns(2).Width = 25
            list.Columns(3).Width = 200
            list.Columns(4).Width = 50
        End Sub
    End Class

    By the way, are you aware of the Developers' forum? May be a better place for development queries like this - and rumour has it that development support may even look at it once in a while!

  • 0 in reply to Geoff Turner

    thank you. I will have a look at the site. last time I went there no one answer my question so I thought the site is not active.

Reply Children
No Data