On 6 Sep, 14:30, WebBuilder451
<WebBuilder...@discussions.microsoft.comwrote:
Can a list contain a series of tablecells?
I iuse lists in coldfusion rather than arrays because the language is based
on lists. I've been avoiding lists in cs. Can i reference item in a list as i
would a 2dem array which is what i need here.
List<Tallows type-safe access to any such list, i.e. List<TableCell>
list... however, if you are mixing your UI and DAL this way (which can
get confusing), then why not just use a TableRow for each row, which
has Cells collection, and (back a step) a Table which has a Rows
collection... i.e. if you are using controls, you shouldn't need to do
any of this yourself. Then you can look at myTable.Rows[3].Cells[2]
etc
I did not use a datatable
because i understood that a reader would be quicker.
Ultimately, I'm not a big fan of DataTable, but do you have any
evidence that the "2 minutes to implement" approach isn't sufficient?
It might be the most pragmatic route in, especially if you are binding
to a grid dynamically. Of course, if all you want to do is display
data, there may be other options too. If you aren't super-optimising,
then I'd keep it simple initially. If you *are* super-optimising (for
a good, proven reason; don't just assume it will be "slow"), then I
wouldn't be bothering with TableCell at all - I'd just be writing to
the raw ouput stream in the render pipeline.
Marc