Click to See Complete Forum and Search --> : Selection List Control


davidbell
July 30th, 2008, 04:38 AM
I am looking for a control that can read in a file deliminated by what ever character I decide and putting this info into a grid,

once I ahve the grid I would like to be able to select an item on the grid and delete it which in turn would delete the "record" from the text file.

is there something I can use for this if not how would I go about making it?


Thanks in Advance

DAve

davidbell
July 30th, 2008, 06:10 AM
Thought I should say I am using DOT NET FW 2.0

crackersixx
July 30th, 2008, 11:32 AM
Since you dont have a specific question, you can start by reading about working with files in c#:

http://msdn.microsoft.com/en-us/library/system.io.file.aspx

and possibly the datagrid control:

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagrid.aspx

JonnyPoet
July 30th, 2008, 01:16 PM
I am looking for a control that can read in a file deliminated by what ever character I decide and putting this info into a grid,...
You may look for thisforever, there is no such control, if you need this behaviour, you need to design it yourself. Look for streams like FileStream and TextReader, TextWriter class and you will be able to create the code you need. Its all in the System.IO namespace

davidbell
July 31st, 2008, 03:18 AM
sorry I was not very clear,
I know all the file and text stuff it was just the grid part.

I take it a data grid it the best way, meaning I wont need to create my own grid, just I thought a data grid was for databases and not for somthing as simple as a text file.

Cheers,

Dave

JonnyPoet
July 31st, 2008, 03:24 AM
sorry I was not very clear,
I know all the file and text stuff it was just the grid part.

I take it a data grid it the best way, meaning I wont need to create my own grid, just I thought a data grid was for databases and not for somthing as simple as a text file.

Cheers,

DaveSimple take a datagridview. It also works if you dont want to bind your data to a datasource directly.

davidbell
July 31st, 2008, 04:32 AM
but how do i populate it from an array?