StrataFrame Forum

Filtering second RepositoryItemLookUpEdit based on value in the first one.

http://forum.strataframe.net/Topic16697.aspx

By StarkMike - 5/29/2008

I have two RepositoryItemLookUpEdits in an XtraGrid... How do I filter the second RepositoryItemLookUpEdit based on the selection I made in the first one?



This is what I found on DevExpress' website but I'm not sure I understand this or that this would be the best way given the fact that i am using StrataFrame and BOs.



http://www.devexpress.com/Support/Center/KB/p/A237.aspx?searchtext=filter+repositoryitemlookupedit&tid=4b2d6f97-c4ae-48fc-87f6-8c5da6541e40&pid=-1



P.S. I know this isnt exactly your product but I thought somebody in here has done this. :-D
By Trent L. Taylor - 5/29/2008

This should have nothing at all to do with SF or a bound BO...this relates to how the grid will behave or react...we don't use DevExpress controls (aside from creating the wrapper), so without going and setting up a sample, I won't be able to give you much direction, sorry Ermm
By StarkMike - 5/29/2008

No problem Trent... I knew you guys didnt do much with it... I was addressing the masses... ;-)

Thanks for your prompt reply anyway.. I know I can count on you guys when it DOES involve  your product. :-D

By Trent L. Taylor - 5/29/2008

Thanks for your prompt reply anyway.. I know I can count on you guys when it DOES involve  your product

Thanks for your kind words....we try anyway Smile

By Peter Denton - 5/29/2008

G'day

We use Strataframe and devexpress, and have had to filter one lookup on another lookup a number of times. What we do is use a bo as the basis for each lookup and have a stored procedure to populate each, then we use the CellValueChanged event to repopulate the lookup appropriately. The following shows a Country/States example in a cardview where a Company is being defined that has both a Delivery and Postal address which could potentially be in different countries, a gridview should be similar.

Private Sub CardView_CellValueChanged(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs) _

Handles CardView1.CellValueChanged

  Select Case e.Column.FieldName

    Case boCMPFieldNames.CMP_CountryForDeliv.ToString

      Me.BoCMP1.FilterChildRecords()

      Me.BoLookupTableStates.RefreshBO("@CNTID", BoCMP1.CMP_CountryForDeliv.ToString)

    Case boCMPFieldNames.CMP_CountryForPost.ToString

      Me.BoCMP1.FilterChildRecords()

      Me.BoLookupTableStates.RefreshBO("@CNTID", BoCMP1.CMP_CountryForPost.ToString)

    Case Else

       ' no action

  End Select

End Sub

It's a while since I looked at this so I'm not entirely sure what the "FilterChildRecords" does in relationship to the Country state relationship.

I hope this helps

Peter