Thanks Andrew.  However in the datagrid the column is a templated one
containing other data as well as the links we have to add just before
display, and the links-related data arrives in several fields - and
potentially more than one row of it - in the dataset.

The data isn't predictable enough to immediately edit column cell text with
IndexOf and string functions.  Adding predictable identifiers or separators
to the data coming from the database is not an option, even if we could
overcome our embarrassment at such an ugly kludge.  Adding predictable
identifiers to the dataset before it's bound to the grid means processing
the whole dataset, which is what we're trying to get away from in the first
place! :-)

So I'm back to wondering if there's a way to know which rows in the dataset
the datagrid is going to display when the datagrid is bound to it, without
doing all the work we had to do in ASP to page data.

Maybe we're on the wrong track altogether.  We have to show, in one column,
document information including the title, description, and publication date
of a document.  Beneath these in the same column must be 1-M sets of links
to versions of the document (may be in Word, and/or in PDF, and/or in
Powerpoint, etc.) with each set including an image, link to the file, link
to the application source, and file description (size, type).

We get the data for these file links in a dataset as child rows to the
document rows, and currently they are processed in the dataset into a single
string of HTML (including <br>s between rows) and inserted into a new column
in the dataset, which is then used by the datagrid during construction of
the templated column.  We've considered storing the complete HTML links-in
description of each file in the database in addition to its component parts,
but that introduces major maintenance challenges.  Also, the possibility of
more than one file per document means that we'd STILL have to process the
whole dataset to insert <br>s between rows of file descriptions/links.

If anyone is still reading :-) thanks for your enduring interest and any
suggestions you may have.

TIA



-----Original Message-----
From: Andrew Zetterman [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 16, 2003 1:43 PM
To: dotnet
Subject: RE: Modify just the visible rows in paged datgrid?


You can loop through the items that are displayed in the datagrid.

foreach (DataGridItem item in MyDataGrid.Items)
{
        if(item.ItemType == ListItemType.Item || item.ItemType ==
ListItemType.AlternatingItem)
        {
                item.Cells[0].Text = "blah";
        }
}

Hope that helps,

Andrew

-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 16, 2003 12:40 PM
To: dotnet
Subject: Modify just the visible rows in paged datgrid?



A dataset is being displayed in a standard paged datagrid control.

Part of the displayed data has to be processed on-the-fly (HTML-formatted
with hot links to display in a templated column of the
datagrid.) Currently, it is being processed by looping through the dataset
just prior to binding it to the datagrid.  However if the dataset became
large over time, we'd be wasting resources on HTML formatting many rows that
won't be visible in the datagrid.

Is there a clever way of determining which rows in the dataset are going to
be visible in the currently-requested page of the datagrid?  If not, has
anyone who has done this the hard way willing to share code or advice?

Any other ideas welcome too.

TIA


---
You are currently subscribed to dotnet as: [EMAIL PROTECTED] To
unsubscribe send a blank email to %%email.unsub%%

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search Subscription
Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/



---
You are currently subscribed to dotnet as: [EMAIL PROTECTED] To
unsubscribe send a blank email to %%email.unsub%%

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search Subscription
Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/





---
You are currently subscribed to dotnet as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/


Reply via email to