My experience is that the grid will resize itself to the edge of the sheet, only holding the top and left location. Even though I set the size to be smaller so that I can have other controls below or to the right of the grid, the form will increase the size of the grid to reach to the right and bottom edges of the form. Thus covering up controls that I have place below or to the right of the grid. So if you don’t place any controls to the right or below the grid then there is no problem.
The code below is what I added to my customization to be able to control the resizing of the grid. In the example I have two grids that I monitor to resize. Each grid is on a separate sheet and both have a label control below them. This may have been a snippet of code from the group. I am not sure.
I hope this help more than confuses.
the formload function
{
UD01Form.Width = 930;
UD01Form.Height = 656;
((System.Windows.Forms.Form)UD01Form).MinimumSize = new System.Drawing.Size(592, 523);
ValidateGridSize(ref ugdSalesData, true);
ValidateGridSize(ref ugdStockData, false);
}
private void ValidateGridSize(ref Epicor.Mfg.UI.FrameWork.EpiUltraGrid myGrid, bool bSalesGrid)
{
int nWidth = myGrid.FindForm().Width;
int nHeight = myGrid.FindForm().Height;
myGrid.Width = (nWidth - 50);
myGrid.Height = (nHeight - 266);
if(bSalesGrid == true)
lblSalesRecordCnt.Top = myGrid.Location.Y + myGrid.Height + 5;
else
lblStockRecordCnt.Top = myGrid.Location.Y + myGrid.Height + 5;
myGrid.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
}
private void ugdSalesData_Resize(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
ValidateGridSize(ref ugdSalesData, true);
ValidateGridSize(ref ugdStockData, false);
}
private void ugdStockData_Resize(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
ValidateGridSize(ref ugdSalesData, true);
ValidateGridSize(ref ugdStockData, false);
}
/***********************************************/
//Here is another example of resizing two grids on the same sheet
private void ValidateGridSize()
{
int nWidth = ugdBOMGrid.FindForm().Width;
int nHeight = ugdBOMGrid.FindForm().Height;
int nCriteriaAreaPlusFooting = 250 + 25;
int nSpaceBtwnGrids = 5;
ugdBOMGrid.Width = (nWidth - 50);
ugdBOMGrid.Height = (int)((nHeight - nCriteriaAreaPlusFooting) * 0.6);
ugdTimePhase.Left = ugdBOMGrid.Left;
ugdTimePhase.Top = ugdBOMGrid.Top + ugdBOMGrid.Height + nSpaceBtwnGrids;
ugdTimePhase.Width = ugdBOMGrid.Width;
ugdTimePhase.Height = (int)((nHeight - nCriteriaAreaPlusFooting) * 0.4);
btnShowSize.Left = ugdBOMGrid.Left;
btnShowSize.Top = ugdTimePhase.Top + ugdTimePhase.Height + nSpaceBtwnGrids;
ugdBOMGrid.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
bGridSizeSet = true;
}
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
On Behalf Of Joe Rojas
Sent: Thursday, January 30, 2014 10:42 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Resize controls when screen is resized
Perfect Steven!
It was the anchor property and it works as described.
Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... |
www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring
[cid:79f99a.png@94b71ed7.4ea88641]
This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that
any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Steven Gotschall
Sent: Thursday, January 30, 2014 1:20 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Resize controls when screen is resized
I don't have it in front of me, but when viewing the properties of the grid, at the top should be a square with a top, bottom, left, and right arrow. Click on it and make sure all four arrows are selected. This set the controls anchor points, and with all 4
set it will re-size with the window.
Steven G.
On Thursday, January 30, 2014 12:15 PM, Joe Rojas <jrojas@...> wrote:
Hello,
I added a new sheet to Order Tracker that will contain a grid.
While designing the customization, I will size the grid to take up the entire width of the sheet.
What I’m looking for is how to resize the grid if the Order Tracker is resized (maximized, restored, manually resized).
Has anyone done this before? If yes, could you explain or share a code snippet?
Thanks All!
Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring
[cid:b2c7ba.png@f29e21f7.418b89b8]
This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]