473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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!!!

Nov 26 '05 #1
1 1679

There is an OnItemCommand event that is triggered when a button within a row
is clicked which provides you with a parameter of type
DataGridCommandEventArgs. This parameter supplies you with the equivalent of
the CurrentRowIndex through its Item.ItemIndex property.

In place of the select method you can add a Hyperlink or a LinkButton that
triggers the selection. You can view the code for these methods in these
demos:

http://www.societopia.net/samples/dataGrid_3c.aspx
http://www.societopia.net/samples/dataGrid_5c.aspx

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
".NETn00b" wrote:
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!!!

Nov 26 '05 #2

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

Similar topics

1
by: Vannela | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different...
0
by: Lori | last post by:
Hi I am selecting a datagrid getting the currentrow, but don't know how I can get the selected value to show up in a textbox Here is my code Dim strCurrentGridID As String =...
2
by: Balamurukan | last post by:
How to retrive property values from our own property window
1
by: Lagur | last post by:
hi im having problem on getting proper CurrentRowIndex in DataGrid when column header is clicked (probably changes position or sorted out). how will i get the previous CurrentRowIndex even the...
2
by: Sunkam Santhoshi | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different...
4
by: guy | last post by:
I have an application with a number of DataGrids bound to collections I get exceptions thown when clicking ad then leaving a grid, but have solved these by clearing the bindings, binding to a...
0
by: Bob Loveshade | last post by:
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 =...
7
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's...
1
by: Bill Fisher | last post by:
Disclaimer, I am very, VERY new to .net. I am currently working with vb.net Visual Studio 2003.and I have a problem with the CurrentRowIndex property of the DataGrid control. I load an xml...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.