473,756 Members | 3,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What if <itemtemplate > does correlate to 1 row in dataset?

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

Nov 18 '05 #1
3 2053
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******** ******@TK2MSFTN GP10.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

Nov 18 '05 #2
Thank you for the reply. Yes, I am using ADO.NET and I think I understand
what you are saying. The repeater wants it already formatted so if it
isn't, I'll have to build a custom data set and then bind it to the repeater
(or even the data grid for that matter since it should suffice).

Thank you again for the quick reply!
Ben

"Jeff" <A@B.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
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******** ******@TK2MSFTN GP10.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


Nov 18 '05 #3
<<<I'll have to build a custom data set and then bind it to the repeater
(or even the data grid for that matter since it should suffice)>>>
Exactly. And I'll add that if the data is read-only (which cross-tab data
inherently is), then you might want to use a Repeater or DataList control
rather than a DataGrid - reason being that the DataGrid is not as
light-weight as the Repeater or DataList, and you won't need all the
features possible in the DataGrid. You bind to a DataList or Repeater just
as you would a DataGrid.
For assistance in chosing how to best display your cross-tab DataSet, check
out the following link:
http://msdn.microsoft.com/library/de...ebcontrols.asp

What you will most likely *not* be doing is programmaticall y adding a new
row to the grid, and then assigning cell values (as was the case with some
of the old COM grids in Windows Client applications (ah, those were the
days!). In the new world you prepare your data in a clean DataSet or
DataTable, behind the scenes, and then bind to whatever control will be
displaying it.

Good Luck.


"Ben Becker" <be*@benbecker. net> wrote in message
news:OJ******** ******@TK2MSFTN GP12.phx.gbl... Thank you for the reply. Yes, I am using ADO.NET and I think I understand
what you are saying. The repeater wants it already formatted so if it
isn't, I'll have to build a custom data set and then bind it to the repeater (or even the data grid for that matter since it should suffice).

Thank you again for the quick reply!
Ben

"Jeff" <A@B.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
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******** ******@TK2MSFTN GP10.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



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1700
by: Andla Rand | last post by:
Hi, I would like to use this feature but in the codebehind. I'm reading from an example text and everything is not codebehind. I would appreciate if you could help me on this. <form runat=server> <asp:DataList id="MyDataList" runat="server" BorderColor="black"
0
2197
by: Mehdi | last post by:
Hi, I have a datagrid which is populated by a dataset. I have a column containing LinkButton that passes MyID and fires my event handler... .... <ItemTemplate> <asp:LinkButton id="btnEdit" CommandName="GoToEditPage" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "MyId")%>' runat="server" Text="Edit"/>
7
1852
by: David Laub | last post by:
I have stumbled across various Netscape issues, none of which appear to be solvable by tweaking the clientTarget or targetSchema properties. At this point, I'm not even interested in "solving" these problems - I'm more interested in isolating them, .i.e. finding a "complete" list of issues. Here's my list of serious issues found so far. By serious, I mean functionality that fails, as opposed to much less serious (albeit annoying) display...
4
2287
by: z. f. | last post by:
Hi, I'm having an aspx page with a server form. i have a grid with a delete button and below the grid, another area with inputs for inserting new values and an "add" button for submiting the lower area of the form. on the lower area i have validators for validating input.
1
4544
by: Jesper Pedersen | last post by:
Hi ! How do I access the following spillerID and Session from another *aspx page in my application? <ItemTemplate> <a href="player_details.aspx?spillerID=<%# DataBinder.Eval(Container.DataItem, "PlayerID") %>" target="_parent"> <%# DataBinder.Eval(Container.DataItem, "playerFirstName") %> <%#
3
2772
by: webserverpete | last post by:
I would like to have multiple <td> in a repeater control. The below code does not work: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" DataMember="DefaultView"> <HeaderTemplate> <table> </HeaderTemplate> <tr> <ItemTemplate> <td>
3
2764
by: | last post by:
I have been researching articles on google on how to create a simple RSS feed that sucks <title><blurb><link><date> out of a sql server 2000 database via an aspx page. I know it has to be pushed into a <xml> document but not sure which direction to take. Is there perhaps a starter document which uses sql server as the data source I can tap into.
3
2947
by: Opa | last post by:
Hi, I have and XMLDataSource which I am using in a GridView control and am customizing the grid with <ItemTemplate>. My XML datasource has an element with an attribute called "private". I want to check the value of the private attribute and if is is true, I DON'T want to display this row of data. I am having trouble with the XPath expression. How is this done? Here is a sample XML source
5
12903
by: Jim in Arizona | last post by:
How do I find a control within a datalist itemtemplate from a sub procedure that isn't a normal called procedure from a datalist (like the update, edit, or cancel procedures)? For instance, normally you find a control and access it's properties and methods, like so: Sub Update(ByVal sender As Object, ByVal e As DataListCommandEventArgs) Dim txtPosted As New TextBox
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9872
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.