问个简单的菜鸟问题 string sItem = ListBox.SelectedItem.ToString(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string [Var]=[ControlsName].SelectedItem.ToString(); 不对,得到的是这个:system.data.datarowview我要的是选中的那个值 TextBox tb; tb = (TextBox)(e.Item.Cells[2].Controls[0]); categoryName = tb.Text; tb = (TextBox)(e.Item.Cells[3].Controls[0]); categoryDescription = tb.Text; dsCategories.CategoriesRow r;r = dsCategories1.Categories.FindByCategoryID(int.Parse(key)); r.CategoryName = categoryName; r.Description = categoryDescription; 不对呀我的combobox是和数据库绑定了的UPUPUPUPUP 好像直接string=ComboBox.selectItem就可以取得值了 string=ComboBox.selectItem就可以取得值了我是将数据表的数据绑定在combobox上的,用那个无法取得 呵呵,我自己解决拉,谢谢大家捧场private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e){ DataColumn dc; DataTable dt=ds.Tables["项目表"]; dc =(DataColumn)dt.Columns["项目名称"]; DataRowView dr; dr=(DataRowView)this.comboBox1.SelectedItem; string select = dr.Row[dc].ToString(); MessageBox.Show(select);} c# socket 异步传输的问题?? 在C#窗体中用一个TIMER,不断遍历所有控件,并将控件.ToBitmap贴到总图 InvokeRequired是什么意思 求路径加密解答。。 Streamwriter 写文本文件的问题 请各位帮帮忙,C#实现不同数据库数据导入 谁知道用匿名方法怎么写? 怎样判断字符串里存的是英文还是中文,或者中英文都有? 诚心请教在componentArt Grid 控件中如何实现下拉框的三级联动 如何给datagrid的特定cell写入指定信息 MDIForm中各form如何共用同一toolbar 问一个关于根据查询语句为datagrid分页的问题。
我要的是选中的那个值
categoryName = tb.Text; tb = (TextBox)(e.Item.Cells[3].Controls[0]);
categoryDescription = tb.Text;
dsCategories.CategoriesRow r;
r = dsCategories1.Categories.FindByCategoryID(int.Parse(key)); r.CategoryName = categoryName;
r.Description = categoryDescription;
我的combobox是和数据库绑定了的
UPUPUPUPUP
string=ComboBox.selectItem就可以取得值了
{
DataColumn dc;
DataTable dt=ds.Tables["项目表"];
dc =(DataColumn)dt.Columns["项目名称"];
DataRowView dr;
dr=(DataRowView)this.comboBox1.SelectedItem;
string select = dr.Row[dc].ToString();
MessageBox.Show(select);
}