第三方控制項devexpress功能挺強大。不過,面對太多的屬性和方法,用起來真的感覺如大海撈針。這2天,專案上修整介面,想在gridcontrol加一列核取方塊列表項。結果,嘗試了n多方法,翻了一堆錯誤,還是沒整出來。最後,還是專案老大幫我解決了。無語!!!2個小錯誤把我折騰的死去活來。廢話少說上**吧。
// this.gcid.caption = "學號";
this.gcid.fieldname = "id";
this.gcid.name = "gcid";
this.gcid.visible = true;
this.gcid.visibleindex = 0;
// // gcname
// this.gcname.caption = "姓名";
this.gcname.fieldname = "name";
this.gcname.name = "gcname";
this.gcname.visible = true;
this.gcname.visibleindex = 1;
// // gcitems
// this.gcitems.caption = "科目";
this.gcitems.columnedit = this.repositoryitemcheckedcomboboxedit1;
this.gcitems.fieldname = "items";
this.gcitems.name = "gcitems";
this.gcitems.visible = true;
this.gcitems.visibleindex = 2;
// // repositoryitemcheckedcomboboxedit1
// this.repositoryitemcheckedcomboboxedit1.autoheight = false;
this.repositoryitemcheckedcomboboxedit1.buttons.addrange(new devexpress.xtraeditors.controls.editorbutton );
this.repositoryitemcheckedcomboboxedit1.name = "repositoryitemcheckedcomboboxedit1";
// // xtragriddemo
// this.autoscaledimensions = new system.drawing.sizef(7f, 14f);
this.autoscalemode = system.windows.forms.autoscalemode.font;
this.clientsize = new system.drawing.size(585, 404);
this.controls.add(this.gridcontrol1);
this.name = "xtragriddemo";
this.text = "gridcontrol填充核取方塊列表項";
this.load += new system.eventhandler(this.xtragriddemo_load);
((system.componentmodel.isupportinitialize)(this.gridcontrol1)).endinit();
((system.componentmodel.isupportinitialize)(this.gridview1)).endinit();
((system.componentmodel.isupportinitialize)(this.repositoryitemcheckedcomboboxedit1)).endinit();
this.resumelayout(false);
}
GridControl常用屬性
this.gridview1.optionsview.showcolumnheaders true 顯示列標題 this.gridview1.optionsview.showindicator true 顯示行標題 this.gridview1.indicatorwidth 40 行標題寬度 顯示行...
GridControl常用設定
清空gridcontrol的drag a column header here說明 gridview1.optionsview.showgrouppanel false gridview 序列寬度設定 indicatorwidth 40 gridcontrol列的寬度根據資料自動填充 1.在填充完資...
GridControl控制項應用
gridcontrol控制項是dev express外掛程式帶的類似於c 內部winform控制項gridview控制項,內部必須新增gridview,同乙個control可以新增多個view datetable型別的資料,新增編號和名稱兩列,將伺服器中查詢到的內容新增到 中 gridcontrol...