WinForm下ComboBox设定SelectedValue总结 (SelectedValue==null解决办法)[转]
摘要:实践发现:以SelectedIndex赋值让ComboBox自动选中时能获得SelectedValue;以SelectedText赋值让ComboBox自动选中时获得SelectedValue为空。即this.comboBox1.SelectedIndex = this.comboBox1.FindString(room);这样能获得comboBox1.SelectedValue值。this.comboBox1.SelectedText = room;这样获得comboBox1.SelectedValue值为空。下面为转帖内容:最近在项目中处理一个winForm中设定ComboBox值,奇怪的
阅读全文
posted @
2013-05-23 23:43
望穿秋水
阅读(11967)
推荐(1) 编辑
C#高效导出Excel(IList转DataTable,DataSet)
摘要:微软的Excel操作类导出Excel会很慢,此方法简单的把表中内容以字符串的形式写入到Excel中,用到的一个技巧就是"\t".C#中的\t相当于Tab键,写入到Excel中时就是一列一列中写入。引用命名空间:using System.Drawing;using System.Threading;using System.IO;using System.Data;using System.Text;using System.Collections;protected void btnExport_Click(object sender, EventArgs e) { thi
阅读全文
posted @
2013-05-19 19:32
望穿秋水
阅读(6646)
推荐(0) 编辑