Accessing Fields within a Collection from UIModel
Is it possible to programmatically access fields within a collection from UIModel.
In this case, I have a list of members in a collection. This collection includes a Is Primary Member field. I'd like to treat this like a radio button, where only one row may be set to true at any given time. I thought about handling this in TSQL, but if someone has clicked three or four people as the primary member, it's a bit of a mess. It would be better to handle this in VB or C# as the value is set on one row, to unset it for all others.
I figured accessing a field within a collection would be the logical place to start, but I can not seem to get any traction on this.
Any suggestions?
Thanks in advance.
Ernie Noa
In this case, I have a list of members in a collection. This collection includes a Is Primary Member field. I'd like to treat this like a radio button, where only one row may be set to true at any given time. I thought about handling this in TSQL, but if someone has clicked three or four people as the primary member, it's a bit of a mess. It would be better to handle this in VB or C# as the value is set on one row, to unset it for all others.
I figured accessing a field within a collection would be the logical place to start, but I can not seem to get any traction on this.
Any suggestions?
Thanks in advance.
Ernie Noa
0
Comments
-
The best way I found is to use foreach loops. You can loop through the collection fields value property that contains objects representing the rows in the collection. For example, you could try something like below to access them. You can also tie into the on-changed event handler for the collection field and access the field the same way to handle the logic. Hope this helps some.
foreach (var m in MEMBERS.Value)
{
m.ISPRIMARY.Value =
}
1 -
Hey Nick,
This is very helpful, I did not know how to access child members of a collection. This has moved me forward a great deal. I wish there was better documentation regarding the methods and properties exposed in VB and C# via the UIModel. Documentation on the XML specs is quite good, but I am left guessing and experimenting with the VB and C#.
I just need to find the right event which fires when a specific record is updated within a collection and how to determine which record called that event. I can set EVERYTHING during various events, but need to hang on to the most recently updated record. I'm close. I bet if I poke around the discussion groups, or elsewhere I can find an example of this.
Thanks for helping. This was terrific.
Best regards,
Ernie0 -
I got this running the way I wanted, but I don't really like the nested loops in my code. There is probably a much better way to find out what row is calling this procedure in my collection, but I haven't found it yet. Thanks again for the help, it got me moving. I had no idea how to access fields in a collection without the assist.
Private Sub BulkCommitteeGroupMemberEditDataFormUIModel_UIFieldChanged(sender As Object, e As UIFieldChangedEventArgs) Handles Me.UIFieldChanged
For Each m In GROUPMEMBERS.Value
If m.Selected = True And m.ISPRIMARY.Value = True Then
m.ISPRIMARY.Value = True
For Each m2 In GROUPMEMBERS.Value
If m2.Selected = False Then
m2.ISPRIMARY.Value = False
End If
Next
End If
Next
End Sub0
Categories
- All Categories
- 6 Blackbaud Community Help
- 209 bbcon®
- 1.4K Blackbaud Altru®
- 395 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 648 Blackbaud Grantmaking™
- 567 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 937 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.5K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 247 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 239 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 31 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 782 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)

