473,396 Members | 1,998 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,396 software developers and data experts.

datagrid row selection

Hey all,

I have a datagrid that has a select column. I've bound an untyped data table
to the datagrid and was just wondering how I would get to all the values of a
row when a user selects a row?

Is there more than one way to do this?

thanks,
rodchar
Nov 19 '05 #1
2 1245
Hi,
I have used the following method with my .Net version 1.1:
private void DataGrid1_ItemCommand(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
firstColVal = e.Item.Cells[0].Text;
secondColVal = en.Item.Cells[1].Text;
.....
}
}

If you have webcontrols such as dropdown list, radio buttons or check boxes
inside each of the rows and wish to retrieve the values for those, you'd need
to use the FindControl() function (I think).
Hope that helps.
Cheers,
Calvin
"rodchar" wrote:
Hey all,

I have a datagrid that has a select column. I've bound an untyped data table
to the datagrid and was just wondering how I would get to all the values of a
row when a user selects a row?

Is there more than one way to do this?

thanks,
rodchar

Nov 19 '05 #2
thank you, this helped.

"Calvin KD" wrote:
Hi,
I have used the following method with my .Net version 1.1:
private void DataGrid1_ItemCommand(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
ListItemType.AlternatingItem)
{
firstColVal = e.Item.Cells[0].Text;
secondColVal = en.Item.Cells[1].Text;
.....
}
}

If you have webcontrols such as dropdown list, radio buttons or check boxes
inside each of the rows and wish to retrieve the values for those, you'd need
to use the FindControl() function (I think).
Hope that helps.
Cheers,
Calvin
"rodchar" wrote:
Hey all,

I have a datagrid that has a select column. I've bound an untyped data table
to the datagrid and was just wondering how I would get to all the values of a
row when a user selects a row?

Is there more than one way to do this?

thanks,
rodchar

Nov 19 '05 #3

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

Similar topics

2
by: Chris Plowman | last post by:
Hi all, I was wondering if anyone can help me with a really annoying problem I have been having. I made a derived datagrid class that will select the row when a user clicks anywhere on a cell...
6
by: BBFrost | last post by:
I'm using Net 1.1 (2003) SP1 & Windows 2000 Here's the issue ... Rows 12 thru 24 are selected in a datagrid. The user now unselects rows 12 thru 24 and selects rows 45 thru 70 ??? How can...
0
by: MrNobody | last post by:
hey guys... I'm trying to make my DataGrid have selection behavior similar to WindowsExplorer, where I can hold CTRL to add rows to a multi-row selection. Thanks to someone else on this...
5
by: I am Sam | last post by:
I have a rather complicated problem I need to sort out and wonder if anyone can assist me. The ingredients: Two DropDownList Controls One DataGrid Purpose of Page:
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.