Datagrid advice

  • Thread starter Thread starter Mark Rae
  • Start date Start date
M

Mark Rae

Hi,

I'm about to begin writing a Windows (not Web) app in C#, and one of the
requirements is to allow users to enter into some sort of tabular control a
few (say, up to 5) records which specify interest rates and terms. I'd like
these to be dynamically editable if possible so that users can insert,
update and delete these records in situ. Additionally, I'd like the term
column to be a dropdown. The columns will be as follows:

Col 1 Dynamically generated record identifier (1, 2, 3 etc)

Col 2 Interest rate (e.g. 3.67%, 4.52%, 5.26% etc)

Col 3 Dropdown containing the following values (which represent numbers
of months):
"12 (1 year)"
"24 (2 years)"
"36 (3 years)"
"48 (4 years)"
"60 (5 years)"
etc, all the way up to "420 (35 years)"

I don't want to use any sort of database such as a Jet file to hold this
information, as that would be total overkill due to the small number of
records. Having had a cursory look at the System.Windows.Forms.DataGrid
control, I don't believe this will do the job, and I'm now looking to take
advice on what would be best to meet the requirements. I guess I could use
something like the Sheridan Data Control (is there a .NET version of this),
or is there a better way?

Any assistance gratefully received.

Best regards,

Mark Rae
 
Hi Mark,

One easy way of doing this IF you know for sure that the record number will
not get much bigger is using a ListView to display the data and a set of
controls to edit the selected value on the listview.

Like this, you have a listview and in the onSelectedIndexChange event you
update the controls to display the values from the selected record. you
could also have a button to insert a new record in the listview which then
follow the same logic that for an existen record.

In order to save the records between execution you can use a XML file or a
CSV file, if you are using a dataset to keep the values then using a XML is
a trivial operation.


Hope this help,
 
Thanks very much - I pretty much figured out for myself exactly what you
suggest, so I'm encouraged :-)
 
Back
Top