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
405
Set Row Edit Template Location before displaying
posted

Hi,

I have a multiband grid with each band having its own row edit template. I've added 2 buttons on the template which will allow a user to traverse between the bands without having to closeout and reopen the row edit template again. However, when moving between bands since I am manually closing and reopening the new band's template, the new template opens up in the default position.

I would like to provide the user with a seamless transition when moving between bands. To this end, I tried to capture the X & Y coordinates of the row edit template on closing and tried to set it on the template again before it is displayed again.

For some reason though this code always seems to return the X and Y position as 0.

Here is my code, any help is much appreciated-

Private Sub ugVersion_BeforeRowEditTemplateClosed(sender As Object, e As BeforeRowEditTemplateClosedEventArgs) Handles ugVersion.BeforeRowEditTemplateClosed
x_location = e.Template.Location.X
y_location = e.Template.Location.Y
End Sub

Private Sub ugVersion_BeforeRowEditTemplateDisplayed(sender As Object, e As BeforeRowEditTemplateDisplayedEventArgs) Handles ugVersion.BeforeRowEditTemplateDisplayed
e.Location = New System.Drawing.Point(x_location, y_location)

EnableDisableCVTemplateControls(True)
End Sub