|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using LumenWorks.Framework.IO.Csv;
using LumenWorks.Framework.Tests.Unit.IO.Csv;
namespace CsvReaderDemo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (CachedCsvReader csv = new CachedCsvReader(new StringReader(CsvReaderSampleData.SampleData1), true))
{
dataGrid1.DataSource = csv;
}
button2.Enabled = true;
}
private void button2_Click(object sender, EventArgs e)
{
ITypedList tList = (ITypedList) ((IListSource) dataGrid1.DataSource).GetList();
IBindingList bList = (IBindingList) tList;
int index = bList.Find(tList.GetItemProperties(null)[0], "Stephen");
dataGrid1.Rows[index].Selected = true;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Sébastien Lorion is software architect as day job.
He is also a musician, actually singing outside the shower
He needs constant mental and emotional stimulation, so all of this might change someday ...