Typed list bound to Janus Gridex

Posts   
 
    
RobBa
User
Posts: 4
Joined: 22-Jun-2006
# Posted on: 25-Jul-2006 10:20:29   

Hi,

I previously asked this question and was given the answer below that works fine, thanks. Now I am binding a typed list to a Janus grid and need to know which row has been selected. The same approach doesn't work, I assume because the typed list is not a collection of entity objects. How would I get the selected row from the grid?

Thanks.

RobBa wrote:
This is probably a really dumb question

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.

Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 25-Jul-2006 13:42:42   

RobBa wrote:

Hi,

I previously asked this question and was given the answer below that works fine, thanks. Now I am binding a typed list to a Janus grid and need to know which row has been selected. The same approach doesn't work, I assume because the typed list is not a collection of entity objects. How would I get the selected row from the grid?

Thanks.

RobBa wrote:
This is probably a really dumb question

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.

Hi,

Use the same idea:

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

  2. Get the current selected TypedListRow using the cm.position: electedMyTypedListRow = MyTypedList.Rows(cm.position)

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

RobBa
User
Posts: 4
Joined: 22-Jun-2006
# Posted on: 25-Jul-2006 14:24:14   

Thank you!

I was almost there. I had

electedMyTypedListRow = MyTypedList(cm.position)

instead of

electedMyTypedListRow = MyTypedList.Rows(cm.position)

simple_smile