在Vs2005 DataGridView 中入一列属性为DataGridCombobox问题 我该怎么把DataSet中的数据绑定到DataGridView 中的ComboBox中的呢??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以在EditingControlShowing事件例如private void GridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e){ if (e.Control is DataGridViewComboBoxEditingControl) { if (this.GridView1.CurrentCellAddress.X == titleColumn.DisplayIndex) { comboTitle = e.Control as ComboBox; if(comboTitle != null) { comboTitle.DropDownStyle = ComboBoxStyle.DropDown; comboTitle.DataSource = MyDataSet.Tables[0]; comboTitle.SelectedIndexChanged -= new EventHandler(Combobox_SelectedIndexChanged); comboTitle.SelectedIndexChanged += new EventHandler(Combobox_SelectedIndexChanged); } } } 哪位大神给点winform的皮肤插件 关于Visual 2008 中MenuStrip控件的左右问题? 关于。NET项目发布 老问题,报表的问题,帮忙看看 请教C#操作数据库的事务问题 请教 一个数据库还原问题? 问一下,C#中变量生存期的问题 VS2008 .NetFramework3.5 DataGridView 同步数据到绑定的数据源和数据库 窗口间的互相调用 在DataGridTextBoxColumn中怎么指定某一行的颜色? 哪位能不能通俗的解释一下Thread Affinity到底是什么东东? 如何控制DataSet中的表
例如
private void GridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (e.Control is DataGridViewComboBoxEditingControl)
{
if (this.GridView1.CurrentCellAddress.X == titleColumn.DisplayIndex)
{
comboTitle = e.Control as ComboBox;
if(comboTitle != null)
{
comboTitle.DropDownStyle = ComboBoxStyle.DropDown;
comboTitle.DataSource = MyDataSet.Tables[0];
comboTitle.SelectedIndexChanged -= new EventHandler(Combobox_SelectedIndexChanged);
comboTitle.SelectedIndexChanged += new EventHandler(Combobox_SelectedIndexChanged);
}
} }