예제 #1
0
        private void CreateGridView(Control container)
        {
            using (MixERPGridView grid = new MixERPGridView())
            {
                grid.ID = "SalesByGeographyGridView";
                grid.CssClass = "initially hidden";
                grid.DataSource = SalesByGeography.GetSalesByCountry(AppUsers.GetCurrentUserDB());
                grid.DataBind();

                container.Controls.Add(grid);
            }
        }
예제 #2
0
        private void LoadGrid(string indices, string styles)
        {
            List<string> styleList = styles.Split(',').ToList();

            int counter = 0;

            foreach (string data in indices.Split(','))
            {
                string style = styleList[counter];

                string ds = data.Trim();

                if (!string.IsNullOrWhiteSpace(ds))
                {
                    int index = Conversion.TryCastInteger(ds);

                    using (MixERPGridView grid = new MixERPGridView())
                    {
                        grid.EnableTheming = false;

                        grid.ID = "GridView" + ds;
                        grid.CssClass = "report";
                        grid.Width = Unit.Percentage(100);
                        grid.GridLines = GridLines.None;
                        grid.RowDataBound += this.GridView_RowDataBound;

                        grid.DataBound += this.GridView_DataBound;
                        this.gridPlaceHolder.Controls.Add(grid);

                        grid.DataSource = this.dataTableCollection[index];
                        grid.DataBind();

                        if (!string.IsNullOrWhiteSpace(style))
                        {
                            grid.Attributes.Add("style", style);
                        }
                    }

                    counter++;
                }
            }
        }