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
- 206 bbcon®
- 1.4K Blackbaud Altru®
- 394 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 357 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 561 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 934 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.4K Blackbaud Raiser's Edge NXT®
- 3.6K SKY Developer
- 242 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 238 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 28 PowerUp Challenges
- 3 (Open) 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
- 778 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)

