CanRemoveItem property

CanRemoveItem property

Old forum URL: forums.lhotka.net/forums/t/6453.aspx


Fel posted on Wednesday, February 18, 2009

Hello.
I have page with a couple fields and grid. They are bind to parent-child object.
Grid has two additional button columns "Select" and "Remove".
When data is fetch from server, fields and grid are populated with correct info but
Remove buttons are disabled.

I can't figure out why.

This is Silverlight project.

Xaml code for Remove button:

 <Button x:Name="RemoveBooking" Content="Remove"
      csla:InvokeMethod.MethodName="RemoveItem"
      csla:InvokeMethod.Resource="{StaticResource HouseData}"
      csla:InvokeMethod.TriggerEvent="Click"
      csla:InvokeMethod.MethodParameter="{Binding}"
      IsEnabled="{Binding Source={StaticResource HouseData}, Path=CanRemoveItem, Mode=OneWay}"/>
      
Thanks

RockfordLhotka replied on Wednesday, February 18, 2009

Is HouseData providing access to the BB root, or the BLB?

I assume it is the BB, which can't do a Remove because it isn't a collection. You need to aim at a data provider that works with the BLB.

Fel replied on Wednesday, February 18, 2009

Ok. You are correct. HouseData is BB.

Then, what should I do to support parent-child object?

Is it way to do it with two data providers?

Copyright (c) Marimer LLC