C# dev GridControl绑定数据不能显示

2020-09-11 15:07:55 浏览数 (1)

如题, dev GridControl绑定数据不能显示时可检查数据操作顺序

代码语言:javascript复制
                view = advBandedGridView1 as AdvBandedGridView;  //第1
                this.advBandedGridView1.OptionsBehavior.Editable = true;  //打开编辑
                view.Columns.Clear(); //注意清空
                view.OptionsView.EnableAppearanceOddRow = true;
                view.OptionsView.ShowColumnHeaders = false;  //显示标题
                view.Bands.Clear();  //注意清空
                search = Oleno.BLL.BLL_OXkcqb.getHasOXkcqbInfo(Oleno.MODEL.Static.Basis_xkcqb.Style_no, Oleno.MODEL.Static.Basis_xkcqb.NewStyelConfirm_Main_ID);  //注意顺序
                if (search == null | search.Rows.Count < 1) return;

                this.style.Text = search.Rows[0]["款式"].ToString();
                this.produGroup.Text = search.Rows[0]["生产帮组"].ToString();
                this.versionNo.Text = search.Rows[0]["流水号"].ToString();
                this.teacher.Text = search.Rows[0]["技师"].ToString();
                this.lookUpEdit_color.Text = search.Rows[0]["颜色"].ToString();

                this.grid_XkcqbInfo.DataSource = search; //第2步

                cpccbw = view.Bands.AddBand("尺寸部位");
                cpgcfw = view.Bands.AddBand("公差范围( /-)");
                cpggcc = view.Bands.AddBand("尺寸规格(CM)");

                this.advBandedGridView1.PopulateColumns();  //特别特别需要注意顺序 //第3步
                for (int i = 0; i <5; i   )
                {
                    view.Columns[i].Visible = false;  // 第4步
                }

0 人点赞