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
80
RowEditTemplate how to programatically set location or how to dock template
posted

it's my first post so at the begining I will say hello to everybody

My question is if it's possible to programaticaly set location of template or dock template in e.g panel, I've tried to manualy set Location of the template in BeforeRowEditTemplateDisplayed event, I also added panel to my form and then dock template on my panel, but none of them seems to work

 

regards

Krzysztof Szepietowski

Parents
No Data
Reply
  • 30
    posted

    The RowEditTemplate opens onto a parent Templateforms control so you need to set the location of that to be able to affect the location of the RowEditTemplate.     I was only able to get it to work in the AfterRowEditTemplateDisplayed event as the parent control doesn't seem to exist yet in BeforeRowEditTemplateDisplayed.    To move the location up 200 pixels you would use:

     

     

    private void grdMYGRID_AfterRowEditTemplateDisplayed(object sender, AfterRowEditTemplateDisplayedEventArgs, e)

    {

    retMYRET.Parent.Top -=200;

    }

     

Children