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
435
resizing a ultragridrowedittemplate
posted

Hi I want to resize the ultragridrowedittemplate screen while it is dispayed depending on what is the value of a field on it. It works fine while opening the screen by selecting a row in the grid, but when I update the field or want to create a new row it goes wrong and I get scroll bars

This the code I'm using until now:

 Private Sub grdretCompetitions_Enter(sender As Object, e As EventArgs) Handles grdretCompetitions.Enter
        If ugcpType.Text <> "AP" And ugcpType.Text <> "TAP+" Then
            lblJrAg.Visible = False
            ugcpJrAg.Visible = False
            lblInterclub.Visible = False
            ugcpInterclub.Visible = False
            grpChampionship.Visible = False
            grpLimitations.Visible = False
            grpNotes.Visible = False
            grpSelections.Visible = False
            grpWeekend.Visible = False
            btnTemplateOk.Location = New Point(370, 200)
            btnTemplateCancel.Location = New Point(450, 200)
            grpCompetitions.Size = New Size(550, 235)
            grdretCompetitions.Size = New Size(550, 235)

        Else
            lblJrAg.Visible = True
            ugcpJrAg.Visible = True
            lblInterclub.Visible = True
            ugcpInterclub.Visible = True
            grpChampionship.Visible = True
            grpLimitations.Visible = True
            grpNotes.Visible = True
            grpSelections.Visible = True
            grpWeekend.Visible = True
            btnTemplateOk.Location = New Point(587, 350)
            btnTemplateCancel.Location = New Point(667, 350)
            grpCompetitions.Size = New Size(765, 385)
            grdretCompetitions.Size = New Size(765, 385)
        End If
    End Sub

    Private Sub ugcpType_LostFocus(sender As Object, e As EventArgs) Handles ugcpType.LostFocus
        If ugcpType.Text <> "AP" And ugcpType.Text <> "TAP+" Then
            lblJrAg.Visible = False
            ugcpJrAg.Visible = False
            lblInterclub.Visible = False
            ugcpInterclub.Visible = False
            grpChampionship.Visible = False
            grpLimitations.Visible = False
            grpNotes.Visible = False
            grpSelections.Visible = False
            grpWeekend.Visible = False
            btnTemplateOk.Location = New Point(370, 200)
            btnTemplateCancel.Location = New Point(450, 200)
            grpCompetitions.Size = New Size(550, 235)
            grdretCompetitions.Size = New Size(550, 235)
            grdretCompetitions.Refresh()
        Else
            lblJrAg.Visible = True
            ugcpJrAg.Visible = True
            lblInterclub.Visible = True
            ugcpInterclub.Visible = True
            grpChampionship.Visible = True
            grpLimitations.Visible = True
            grpNotes.Visible = True
            grpSelections.Visible = True
            grpWeekend.Visible = True
            btnTemplateOk.Location = New Point(587, 350)
            btnTemplateCancel.Location = New Point(667, 350)
            grpCompetitions.Size = New Size(765, 385)
            grdretCompetitions.Size = New Size(765, 385)
            grdretCompetitions.Refresh()
        End If
end sub
See screens
the two screens show what happens if a change the value of the field if I open any row after that it gives me the 3rd screen
    End Sub
  • 12480
    Offline posted

    Hi Ronny,

    In order to size the RowEditTemplate after it has been shown, you will need to resize the actual form containing it. As a simple example, you can change the width using this simple code:

    ultraGridRowEditTemplate1.FindForm().Width = 1000

    In your case, you would instead want to calculate both the height and width from your controls, then set the size to your calculated values.

    Please try this out and let me know whether it works.