public async void GetActualWidthAndHeight() { if (!bvgGrid.HasMeasuredRect) { bvgGrid.bvgSize.W = await BvgJsInterop.GetElementActualWidth(bvgGrid.DivContainerElementID); double top = await BvgJsInterop.GetElementActualTop(bvgGrid.DivContainerElementID); double windowHeight = await BvgJsInterop.GetWindowHeight(); bvgGrid.bvgSize.H = windowHeight - top - 30; bvgGrid.HasMeasuredRect = true; if (bvgGrid.bvgSettings.LayoutFixedOrAuto) { if (bvgGrid.bvgSettings.CompWidth < bvgGrid.bvgSize.W) { bvgGrid.bvgSize.W = bvgGrid.bvgSettings.CompWidth; } if (bvgGrid.bvgSettings.CompHeight < bvgGrid.bvgSize.H) { bvgGrid.bvgSize.H = bvgGrid.bvgSettings.CompHeight; } } } if (bvgGrid.bvgSize.H > bvgGrid.RowsTotalCount * bvgGrid.bvgSettings.RowHeight + bvgGrid.bvgSettings.HeaderHeight) { bvgGrid.bvgSize.H = bvgGrid.RowsTotalCount * bvgGrid.bvgSettings.RowHeight + bvgGrid.bvgSettings.HeaderHeight; } CheckSizeLimits(); bvgGrid.AdjustSize(); RestoreComponentReferences(); RenderGridColumns(0, false); RenderGridRows(0, false); ActualRender = true; //EnabledRender = true; //bvgGrid.SelectCell(bvgGrid.Rows.First().Cells.First(), true); StateHasChanged(); //EnabledRender = false; }
public async void GetActualWidthAndHeight() { bvgGrid.totalWidth = await BvgJsInterop.GetElementActualWidth(bvgGrid.GridTableElementID) - 20; double top = await BvgJsInterop.GetElementActualTop(bvgGrid.GridTableElementID); double windowHeight = await BvgJsInterop.GetWindowHeight(); bvgGrid.height = windowHeight - top - 40; if (bvgGrid.height > bvgGrid.RowsTotalCount * bvgGrid.bvgSettings.RowHeight + bvgGrid.bvgSettings.HeaderHeight) { bvgGrid.height = bvgGrid.RowsTotalCount * bvgGrid.bvgSettings.RowHeight + bvgGrid.bvgSettings.HeaderHeight; } bvgGrid.AdjustSize(); RenderGridColumns(0, false); RenderGridRows(0, false); ActualRender = true; //EnabledRender = true; StateHasChanged(); //EnabledRender = false; }