473,466 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1686

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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.