如何从Glacial ListView中删除数据? [英] How do I remove data from Glacial ListView?

查看:67
本文介绍了如何从Glacial ListView中删除数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的背景是使用StringGrid的Delphi ADO.NET。我找到了很棒的Glacial ListView。我可以将数据放入并查看数据,但我无法理解。我需要做些什么来读取数据?



以下是我在Excel冰川视图中读取excel电子表格的地方。



My background is Delphi ADO.NET using StringGrid. I found Glacial ListView which was great. I can put data in and view the data but I can't get it out. What do I need to do to read data out?

The following is where I read an excel spreadsheet into the Glacial ListView.

GLItem item;
glacialListStudent.Items.Clear();
glacialListStudent.Refresh();
try
  {
	connectExcel = new OleDbConnection(conStr);
	string commandExcel = "Select * from [" + sheetName + "]";
	OleDbDataAdapter daStudent = new OleDbDataAdapter(commandExcel, connectExcel);
	DataSet dsStudent = new DataSet();
	daStudent.Fill(dsStudent, "Student");
	DataTable dtStudent = dsStudent.Tables["Student"];
	int iCol;
	string sTemp;
	foreach (DataRow row in dtStudent.Rows)
	{
		iCol = 0;
		item = glacialListStudent.Items.Add("Student Tutoring");
		foreach (DataColumn col in dtStudent.Columns)
		{
			sTemp = string.Format("{0}", row[col]);
			item.SubItems[iCol++].Text = sTemp + ", ";
		}
	}
	listSelectedSheet.Items.Add(string.Format("Selected Sheet Loaded.{0}", sheetName));
	buttonUpdateStudent.Enabled = true;
	connectExcel.Close();
   }
   catch
   {
	errorMessage = string.Format("Update Student Table with Spreadsheet error = {0,5}", errorMsg);
	MessageBox.Show(errorMessage, sheetName);
   }

推荐答案

如果您的目标是读取数据,为什么不设置循环使用您用于填充列表的相同对象引用:将内容作为'Rows by'项目访问,使用'使用'SubItems属性的列'?



看起来像CP或网站上不再支持Glacial ListView:[ ^ ]。



我还建议你查看菲利普派珀在CP上的经典'ObjectListView,这已经发展了很多年,其中仍然得到积极支持(截至2013年12月):[ ^ ]。
If your goal is to "read the data out" why don't you just set up a loop using the same object references you used to fill the List: access the content as 'Rows by 'Items and, by 'Columns using the 'SubItems Properties ?

Looks like the Glacial ListView is not supported any longer on CP, or, on the web: [^].

I'd also suggest you check out Philip Piper's classic 'ObjectListView here on CP, which has been evolving for many years, and which is still actively supported (as of December, 2013): [^].


我想从glacialListStudent对象中读取数据。它以行和列的形式显示,如Delphi中的StringGrid组件。
I would like to read the data out of the "glacialListStudent" object. It displays in rows and columns like the StringGrid component in Delphi.


这篇关于如何从Glacial ListView中删除数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆