Dev控件库中Grid控件中下拉框级联显示 这个grid控件可以绑定多个下拉列表来进行级联显示吗?ColumnEdit属性只是针对一列的,能够做到只设置指定的单元格中的combobox的数据源吗?devexpressgridcontrolcombobox 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 自己找到方法了。主要是在这个事件中实现的CustomRowCellEditForEditingDevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView; RepositoryItemComboBox cbx = new DevExpress.XtraEditors.Repository.RepositoryItemComboBox(); switch (e.Column.FieldName) { case "DBConstructionName": cbx.Items.Clear(); cbx.Items.AddRange(constructions.Select(c => new Models.ComboBoxItemTextValue<int>(c.ConstructionID, c.ConstructionName)).ToList()); cbx.SelectedValueChanged += new EventHandler(cbx_SelectedValueChanged); e.RepositoryItem = cbx; break; case "DBBuildingName": buildingBll = new BLL.Building(Login.UserId, Login.Password); string constructid = view.GetRowCellDisplayText(e.RowHandle, "DBConstructionID"); //楼栋 buildingIListByDataBase = buildingBll.GetBuilding(iCityID, Convert.ToInt32(constructid), 0); cbx.Items.Clear(); cbx.Items.AddRange(buildingIListByDataBase.Select(b => new Models.ComboBoxItemTextValue<int>(b.BuildingID, b.BuildName)).ToList()); cbx.SelectedValueChanged += new EventHandler(cbx_SelectedValueChanged); e.RepositoryItem = cbx; break; case "DBHouseName": houseBll = new BLL.House(Login.UserId, Login.Password); string bid = gvwFetchData.GetRowCellValue(e.RowHandle, "DBBuildingID").ToString(); //房号 house = houseBll.GetHouseList(Convert.ToInt32(bid), 0, iCityID); cbx.Items.Clear(); cbx.Items.AddRange(house.Select(h => new Models.ComboBoxItemTextValue<int>(h.HouseID, h.HouseName)).ToList()); cbx.SelectedValueChanged += new EventHandler(cbx_SelectedValueChanged); e.RepositoryItem = cbx; break; default: break; } cbx.ParseEditValue += new ConvertEditValueEventHandler(cbx_ParseEditValue); 您好:我刚刚接触DEVExpress,combobox的级联显示已经搞了2天了,还是很模糊,你的这段程序我仔细看过了,可是还是搞不太清楚整个流程,可以告诉我你程序中的字段是来自同一张表还是不同的表吗?十分感激 SendMessage 发送按键消息不成功 请问这两种写法那个是对的? 项目变成了鸡肋,反思之于,痛下决心 好好学习从基础开始 菜鸟学飞(一) 关于WebGrid的简单问题,使用过的高手看过来! 这样的乱码咋搞定啊 注册表操作?? 急:水晶报表错误:fail to get specifical page C#程序如何在没有装过NetFramework的机子上运行? 为什么没人回答问题?在Form设置textbox的databindings的text属性 最近一段时间,我对csdn论坛的看法 GDI+画好的线如何擦除(有背景图片) 未在本地计算机上注册VFPOLEDB提供程序。
{
case "DBConstructionName":
cbx.Items.Clear();
cbx.Items.AddRange(constructions.Select(c => new Models.ComboBoxItemTextValue<int>(c.ConstructionID, c.ConstructionName)).ToList());
cbx.SelectedValueChanged += new EventHandler(cbx_SelectedValueChanged);
e.RepositoryItem = cbx;
break;
case "DBBuildingName":
buildingBll = new BLL.Building(Login.UserId, Login.Password);
string constructid = view.GetRowCellDisplayText(e.RowHandle, "DBConstructionID");
//楼栋
buildingIListByDataBase = buildingBll.GetBuilding(iCityID, Convert.ToInt32(constructid), 0);
cbx.Items.Clear();
cbx.Items.AddRange(buildingIListByDataBase.Select(b => new Models.ComboBoxItemTextValue<int>(b.BuildingID, b.BuildName)).ToList());
cbx.SelectedValueChanged += new EventHandler(cbx_SelectedValueChanged);
e.RepositoryItem = cbx;
break;
case "DBHouseName":
houseBll = new BLL.House(Login.UserId, Login.Password);
string bid = gvwFetchData.GetRowCellValue(e.RowHandle, "DBBuildingID").ToString();
//房号
house = houseBll.GetHouseList(Convert.ToInt32(bid), 0, iCityID);
cbx.Items.Clear();
cbx.Items.AddRange(house.Select(h => new Models.ComboBoxItemTextValue<int>(h.HouseID, h.HouseName)).ToList());
cbx.SelectedValueChanged += new EventHandler(cbx_SelectedValueChanged);
e.RepositoryItem = cbx;
break;
default: break;
}
cbx.ParseEditValue += new ConvertEditValueEventHandler(cbx_ParseEditValue);