I am looking for suggestions on some code rework.
I am looking for suggestions on some code rework.
Given: Data import from a spreadsheet, with column names in the first row. Column order and count are now subject to change.
I must import to a grid, and in the grid, present in-place editors as well as validation for the import data. Numerous of the editors are combo boxes populated from the DB.
What I thought to do was define in a const array the things I must know for each column (column name, header, field name, and so on), and to define this statically. While that works well enough, maintenance of the array is a mind-numbing affair, and as I am now dealing with 9 items for each column, and over 40 columns, well, it's not pretty.
I'd appreciate suggestions from anyone with a neater solution to taming this monster.
Given: Data import from a spreadsheet, with column names in the first row. Column order and count are now subject to change.
I must import to a grid, and in the grid, present in-place editors as well as validation for the import data. Numerous of the editors are combo boxes populated from the DB.
What I thought to do was define in a const array the things I must know for each column (column name, header, field name, and so on), and to define this statically. While that works well enough, maintenance of the array is a mind-numbing affair, and as I am now dealing with 9 items for each column, and over 40 columns, well, it's not pretty.
I'd appreciate suggestions from anyone with a neater solution to taming this monster.
Dorin Duminica "don't fight the alias stuff too much, you'll need it very soon!"
ReplyDeleteYou really want to spoil my morning, don't you? ;)
This app has to produce data which meets Federal requirements, so there are limits on how free-form some things can get. However, if I need to deal with multiple names for any given column, I can do that with CSV constants, too.
OK, I shut up now, dealing with my own demons right now ((:
ReplyDeletehave fun!
Dorin Duminica Keep weapons at the ready, the demons are persistent. ;)
ReplyDeleteThanks for your thoughts.