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
If you want to center the RowEditTemplate on your parent form you would use the following code:
myRET.Parent.Location =
this.PointToScreen(new Point(this.Location.X + (this.Bounds.Width - retDispatch.Width) / 2, this.Location.Y + this.Bounds.Height - retDispatch.Height) / 2));
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;
}