Getting selected row ID from grid

Posts   
 
    
RobBa
User
Posts: 4
Joined: 22-Jun-2006
# Posted on: 22-Jun-2006 16:51:08   

This is probably a really dumb question flushed

Self Servicing & VB .NET Windows Forms.

I have an entity - Reservation with a child collection BookingDetail. The collection is bound to a Janus grid, with just the FirstName & LastName columns visible. How can I find out what the BookingDetailId is of the selected row?

Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 22-Jun-2006 17:40:19   

RobBa wrote:

This is probably a really dumb question flushed

Self Servicing & VB .NET Windows Forms.

I have an entity - Reservation with a child collection BookingDetail. The collection is bound to a Janus grid, with just the FirstName & LastName columns visible. How can I find out what the BookingDetailId is of the selected row?

Hi,

Try the following:

  1. Get the BookingDetail's currencyManager: cm = gridEX.BindingContext(BookingDetail)

  2. Get the current selected BookingDetail using the cm.position: selectedBookingdetail = BookingDetail(cm.position)

  3. Now that you have the selected BookingDetail you can get any property.

RobBa
User
Posts: 4
Joined: 22-Jun-2006
# Posted on: 22-Jun-2006 18:55:51   

I thought it would be something to do with currency manager, now I understand it a bit better.

Thanks for your help, and fast response.

Rob.