Solved

get the last row OnItemDataBound in Datagrid

Posted on 2003-12-10
2
395 Views
Last Modified: 2010-05-18
Hello,

How do i get the last row OnItemDataBound in Datagrid or atleast the number of rows OnItemDataBound in Datagrid?

thanks
Beulah
0
Comment
Question by:Beulah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
seeflat earned 100 total points
ID: 9918255
The answer depends on whether you have paging turned on or off.

If you have paging turned on, then it's simple:
if (e.Item.ItemIndex == dgCurrentFiles.PageSize - 1)
{
                // Do something.
      Response.Write("I am the last row.");
}

If you have paging turned off, then it's a little more difficult:
Assume you have the DataGrid bound to a standard DataSet, called dsDataSet with only one table.

if (e.Item.ItemIndex == dsDataSet.Tables[0].Rows.Count - 1)
{
                // Do something.
      Response.Write("I am the last row.");
}

HTH

0
 
LVL 5

Expert Comment

by:seeflat
ID: 9956758
Any reason why this is a grade of C? It answered your question and gave a working example.

Thanks
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question