Beispiel #1
0
        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;
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        public void SetScrollLeftToNonFrozenColumnsDiv(double p)
        {
            double p2 = p;

            if (LastHorizontalSkip > 0)
            {
                p2 -= bvgGrid.ColumnsOrderedListNonFrozen.Take(LastHorizontalSkip).Sum(x => x.ColWidth);
            }

            BvgJsInterop.SetElementScrollLeft("NonFrozenDiv1", p2);
        }
Beispiel #4
0
 public void CheckboxClicked(UIMouseEventArgs e)
 {
     BvgJsInterop.SetValueToCheckBox(string.Concat("chCell", bvgCell.ID), bvgCell.Value);
     bvgCell.bvgGrid.SelectCell(bvgCell, false);
 }
        public void OnPositionChange(bool b, int index, int p)
        {
            if (!b)
            {
                if (bvgColumn.ColWidth == bvgColumn.bvgGrid.bvgSettings.ColWidthMin && p <= 0)
                {
                    return;
                }


                if (bvgColumn.ColWidth == bvgColumn.bvgGrid.bvgSettings.ColWidthMax && p >= 0)
                {
                    return;
                }



                ushort old_Value_col = bvgColumn.ColWidth;

                bvgColumn.ColWidth = (ushort)(bvgColumn.ColWidth + p);


                if (bvgColumn.ColWidth < bvgColumn.bvgGrid.bvgSettings.ColWidthMin)
                {
                    bvgColumn.ColWidth = bvgColumn.bvgGrid.bvgSettings.ColWidthMin;
                }
                if (bvgColumn.ColWidth > bvgColumn.bvgGrid.bvgSettings.ColWidthMax)
                {
                    bvgColumn.ColWidth = bvgColumn.bvgGrid.bvgSettings.ColWidthMax;
                }


                if (bvgColumn.ColWidth != old_Value_col)
                {
                    bvgColumn.bvgGrid.ColumnsOrderedList.Single(x => x.prop.Name.Equals(bvgColumn.prop.Name)).ColWidth = bvgColumn.ColWidth;

                    if (bvgColumn.IsFrozen)
                    {
                        bvgColumn.bvgGrid.ColumnsOrderedListFrozen.Single(x => x.prop.Name.Equals(bvgColumn.prop.Name)).ColWidth = bvgColumn.ColWidth;
                    }
                    else
                    {
                        bvgColumn.bvgGrid.ColumnsOrderedListNonFrozen.Single(x => x.prop.Name.Equals(bvgColumn.prop.Name)).ColWidth = bvgColumn.ColWidth;
                    }


                    double currScrollPosition = bvgColumn.bvgGrid.HorizontalScroll.compBlazorScrollbar.CurrentPosition;

                    bvgColumn.bvgGrid.CalculateWidths();

                    bvgColumn.bvgGrid.HorizontalScroll.compBlazorScrollbar.SetScrollPosition(currScrollPosition);



                    bvgColumn.bvgGrid.OnColumnResize?.Invoke();

                    if (bvgColumn.IsFrozen)
                    {
                        string[] updatePkg = new string[4];
                        updatePkg[0] = bvgColumn.bvgGrid.GetStyleDiv(true);
                        updatePkg[1] = bvgColumn.bvgGrid.GetStyleTable(true);
                        updatePkg[2] = bvgColumn.bvgGrid.GetStyleDiv(false);
                        updatePkg[3] = bvgColumn.bvgGrid.GetStyleTable(false);


                        BvgJsInterop.UpdateFrozenNonFrozenWidth(updatePkg);
                    }
                }
            }
        }