Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / November 2005

Tip: Looking for answers? Try searching our database.

What is the Equivalent of the CurrentRowIndex Property for a DataGrid Web Control?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
.NETn00b - 26 Nov 2005 19:46 GMT
What is the equivalent of CurrentRowIndex for the DataGrid control in
ASP.NET?

I am trying to convert the following windows app method, to use in an
ASP.NET application:

private void DataGrid1_CurrentCellChanged(object sender, EventArgs e)
{

    int c = DataGrid1.CurrentRowIndex;
    DataGrid1.Select(c);
    DataGrid1_Click( sender,  e);        

}

The problem is that there is no CurrentRowIndex property for the
DataGrid web control. Is there something else I can use, that will give
me similar functionality?

I also need to figure out what I can use in place of the Select method,
which also doesn't exist for the DataGrid web control. Would
SelectedIndex work? Can this method be adapted?

Thanks!!!

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Elton Wang - 27 Nov 2005 03:33 GMT
You can use
datagrid.SelectedIndex

or  in some events, such as ItemDataBound, ItemCommand

use e.Item.ItemIndex

HTH

> What is the equivalent of CurrentRowIndex for the DataGrid control in
> ASP.NET?
[quoted text clipped - 24 lines]
> Sent via .NET Newsgroups
> http://www.dotnetnewsgroups.com 

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.