You don't tell us if you're using ADO.NET - so I'll assume you are because
that would make a lot of sense in .NET programming. If you're not using
ADO.NET, then you should tell us what you are using...
<<<How can I cursor through a data set, >>>
You don't - at least not in the traditional sense of a "cursor" (MoveNext,
MovePrior, Move N are just not part of the ADO.NET game). Rather the ADO.NET
DataSet is comprised of a collection of DataRow objects - so you navigate
through the collection just like you'd navigate any other collection.
The Datagrid, datalist, and repeater are generally designed to be bound to
something (e.g, DataTable) that pretty much already contains what needs to
be presented in the UI. So, one of your options is this:
1. Create a brand new and empty DataTable (or DataSet) in your code (create
it out of thin air - this is not your grand father's ADO). Your complicated
custom logic can add new DataRow objects as necessary. So, the sequence of
events would be something like this: (1) you retrieve your initial DataSet
("uncross-tabbed" data) from your data source, and (2) run it through your
custom logic - which (3) outputs a new DataSet/DataTable. You then (4) bind
your repeater control (DataList, DataGrid, DataRepeater) to the output
DataSet/DataTable.
Jeff
"Ben Becker" <be*@benbecker.net> wrote in message
news:uZ**************@TK2MSFTNGP10.phx.gbl...
I am trying to build a custom crosstab type of grid where I take some
items in a data grid and based on the content of the current item compared to
the previous item, determine if a new row in a table should be created or not.
In order to do this, I need to have full control over the conditional
logic for how items get displayed within a repeater element which I'm not seeing
as possible.
How can I cursor through a data set, apply conditional logic to it as I do
to customize how it is outputed to the screen? The repeater, datagrid and
data list seem great if your query comes back in a table structure where
each record correlates to an item, but if you have 10 records that relate
to a single "item" then I'm lost on how to get it to look like 1 item.
Thanks,
Ben