操作DataGridView 以xml形式保存,拖动需要列的顺序保存,加载,删除文件;Load 事件调用加载文件 (subInitDgv();)//初始化列表 private void subInitDgv() { LoginInfo.BindReadDataGridViewStyle(this.Name, dgvSubbill); }详见下面代码: // 加载XMLDataGridView 样式 public static void BindReadDataGridViewStyle(string strFromName, DataGridView dgvMain) { try { stri Read More
posted @ 2013-04-02 16:15 quanxie Views(936) Comments(1) Diggs(0) Edit
//1) 文本:vnd.ms-excel.numberformat:@ //2) 日期:vnd.ms-excel.numberformat:yyyy/mm/dd //3) 数字:vnd.ms-excel.numberformat:#,##0.00 //4) 货币:vnd.ms-excel.numberformat:¥#,##0.00 //5) 百分比:vnd.ms-excel.numberformat: #0.00%/// <summary> /// 导出Excel(按照拖到的列的顺序)(流) /// </summary> /// <param name=&quo Read More
posted @ 2013-04-02 16:01 quanxie Views(1003) Comments(0) Diggs(0) Edit
private DataSet xsldata() //定义一个dataset并把excel数据读入dataset { dataGridView1.Rows.Clear(); OpenFileDialog openFile = new OpenFileDialog();//打开文件对话框。 openFile.Filter = ("Excel 文件(*.xls)|*.xls");//后缀名。 if (openFile.ShowDialog() == DialogResult.OK) { string filename = openFile.FileName; //文件路径 . Read More
posted @ 2013-04-02 15:52 quanxie Views(562) Comments(0) Diggs(0) Edit