Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 17th, 2003, 07:40 PM
Registered User
Join Date: Jul 2003
Location: , WA, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Find total row count when databinding

This is a hard one to explain, so I'll just go with an example - I'm creating a databound datagrid where one column shows the priority ranking of each row, from 1 to the total number of rows. These will be presented as dropDownLists so that the user can select a new priority for each row.

I've created my own simple user control that creates a dropdownlist with options from 1-TotalRows and then sets the selected index based on the current priority of the item. I have a template column in my datagrid that calls the user control:

<asp:TemplateColumn SortExpression="Priority" HeaderText="Priority">
<ItemTemplate><uc1:myPriority CurrentPriority='<%# DataBinder.Eval(Container.DataItem, "Priority") %>' TotalRows="5" runat="server"></uc1:myPriority>

As you can see, I need to pass two parameters into my usercontrol - the CurrentPriority, which I am easily getting from the current row, but also the TotalRows, which I have no idea how to find. DataBinder doesn't seem to have a way to let me find it here. If I do an .ItemCreated event in my codebehind, I'd be able to get the total number of rows, but I can't figure out a way to pass that as a parameter to my user control. I'm just looking for any way to accomplish this goal.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Total Count of Specific Records in a Report Odeh Naber Access 5 August 1st, 2007 03:50 AM
count the TOTAL number of segments crmpicco Classic ASP Basics 2 February 1st, 2005 05:03 AM
Getting Total Page Count eman2a Crystal Reports 0 August 11th, 2004 10:53 AM
Sub Total, Count discriminating dkaco BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 23rd, 2004 12:04 PM
Total Page Count denis74hd Crystal Reports 4 May 27th, 2004 02:31 AM

All times are GMT -4. The time now is 05:43 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.