Filtering second RepositoryItemLookUpEdit based on value in the first one.


Filtering second RepositoryItemLookUpEdit based on value in the first...
Author
Message
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
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
Reply
Peter Denton
Peter Denton
StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)StrataFrame User (147 reputation)
Group: Forum Members
Posts: 77, Visits: 787
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

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search