Setting a default Selection in a dataform
I've got a report that takes a few Selections and I'd like to default a couple of them. I'm pretty sure I have to use a UI Model for this, but I can't quite get it to work. When I debug it, everything is doing exactly what I intend it to do - except that it doesn't actually set the value for the Selection field. Below is the snippet of code that's not quite doing the trick. Any ideas?
private void EVR1014ReportUIModel_Loaded(object sender, Blackbaud.AppFx.UIModeling.Core.LoadedEventArgs e)
{
string query = "select top 1 id from idsetregister where name = 'Event Registrants - Status = Registered (Ad-hoc Query)'";
using (SqlConnection conn = GetRequestContext().OpenAppDBConnection())
{
using (SqlCommand cmd = new SqlCommand(query, conn))
{
object cmdResult = cmd.ExecuteScalar();
Guid defaultRegistrantSelection = Guid.Empty;
if (cmdResult != null && Guid.TryParse(cmdResult.ToString(), out defaultRegistrantSelection))
_pmregistrantselectionid.Value = defaultRegistrantSelection;
}
}
}
0
Comments
-
Hey Mitchell, try setting your field values in the DefaultValuesLoaded method instead of Loaded.0
-
Thanks, Michael. Unfortunately, no joy. Same result. :-(0
Categories
- All Categories
- 6 Blackbaud Community Help
- 213 bbcon®
- 1.4K Blackbaud Altru®
- 401 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 655 Blackbaud Grantmaking™
- 576 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 939 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.6K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 119 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 241 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 34 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) 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
- 791 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)

