473,397 Members | 2,056 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,397 software developers and data experts.

Selected object in datagrid

DC
Hi all (once again),
I've populated a datagrid with an arraylist of objects of this class i've
created.

How can I get the select object in the datagrid?

TIA,
DC
Nov 21 '05 #1
3 1486
If you are wanting the value of a cell, you would use

datagrid.item(datagrid.currentcell)

you should use that within a mouseDown or mouseUp event of the
datagrid. I dont know if that answers your question, because I dont
100% understand it.

Nov 21 '05 #2
DC
Thanks,
Here's exactly what I want: Just like Listbox select item returns a
reference for MY object, I would like to know if there's any way to have the
reference for MY object in the select item of a datagrid. I don't want to get
the cell value, but a reference to the object of my arraylist.
I hope that's clear now.

"Not Aaron" wrote:
If you are wanting the value of a cell, you would use

datagrid.item(datagrid.currentcell)

you should use that within a mouseDown or mouseUp event of the
datagrid. I dont know if that answers your question, because I dont
100% understand it.

Nov 21 '05 #3
datagrid.item(datagrid.currentcell) is pretty much like a
listbox.selectedItem, they both bring back the value of whats selected.
If you wanted to get the row number of the datagrid thats selected you
could use datagrid.currentRowIndex but I dont know if that corresponds
to your arraylist. Im guessing that the order of your datagrid won't
always be the same as the arraylists order, so I think you could get
the cell value of the selected row in the datagrid and search for its
position in your arraylist. Is this sort of what you're looking for?

Nov 21 '05 #4

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

Similar topics

1
by: kll | last post by:
I have been on newsgroup for week. I have seen anything that will help me. Basically, I have a form with a datagrid that can be sorted or unsorted (it is up to the user). Then, I display the data...
3
by: BBFrost | last post by:
Ok, I know how to count the number of selected datagrid rows using the code below. What has me stumped is how to determine when the selected rows within a datagrid have been changed. The...
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...
5
by: BBFrost | last post by:
Win2000 ..Net 1.1 SP1 c# using Visual Studio Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1 datagrid. I've come to realize that a 'block' of rows highlighted within...
1
by: Empire City | last post by:
I have an ASP.NET form with a DataGrid and Button. I want to put a RadioButtonList in a DataGrid cell. I bind it to an ArrayList which has a ListItem in the cell. The display part works fine. I...
4
by: wolfgang wagner | last post by:
hi all! after successfully integrating a dropdownlist in my datagrid i have another problem: i cannot set the selected index of the dropdownlistbox. here is my code: hardware.aspx...
6
by: Jenna Alten | last post by:
I have a datagrid with a template column that contains a dropdown list. I currently fill and display the dropdown list on the page load. This is working correctly. I am NOT using an Edit Column. I...
6
by: nasirmajor | last post by:
dear all, i have a datagrid with checkboxes for selection of rows. and want to get unique id/ids(job_code) from the selected rows in array etc. can anyone help. <asp:datagrid id="dgResults"...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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.