Esempio n. 1
0
        /// <summary>
        /// Handles the ItemDataBound event of the rptFamilyStatusDataView control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RepeaterItemEventArgs"/> instance containing the event data.</param>
        protected void rptFamilyStatusDataView_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            FamilyStatusDataView groupStatusDataView    = e.Item.DataItem as FamilyStatusDataView;
            HiddenField          hfGroupStatusValueId   = e.Item.FindControl("hfGroupStatusValueId") as HiddenField;
            DataViewItemPicker   dvpGroupStatusDataView = e.Item.FindControl("dvpGroupStatusDataView") as DataViewItemPicker;

            if (groupStatusDataView != null)
            {
                hfGroupStatusValueId.Value          = groupStatusDataView.GroupStatusValue.Id.ToString();
                dvpGroupStatusDataView.EntityTypeId = EntityTypeCache.GetId <Rock.Model.Group>();
                dvpGroupStatusDataView.Label        = groupStatusDataView.GroupStatusValue.ToString();
                dvpGroupStatusDataView.SetValue(groupStatusDataView.DataViewId);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the ItemDataBound event of the rptPersonConnectionStatusDataView control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RepeaterItemEventArgs"/> instance containing the event data.</param>
        protected void rptPersonConnectionStatusDataView_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            PersonConnectionStatusDataView personConnectionStatusDataView = e.Item.DataItem as PersonConnectionStatusDataView;
            HiddenField        hfPersonConnectionStatusValueId            = e.Item.FindControl("hfPersonConnectionStatusValueId") as HiddenField;
            DataViewItemPicker dvpPersonConnectionStatusDataView          = e.Item.FindControl("dvpPersonConnectionStatusDataView") as DataViewItemPicker;

            if (personConnectionStatusDataView != null)
            {
                hfPersonConnectionStatusValueId.Value          = personConnectionStatusDataView.PersonConnectionStatusValue.Id.ToString();
                dvpPersonConnectionStatusDataView.EntityTypeId = EntityTypeCache.GetId <Rock.Model.Person>();
                dvpPersonConnectionStatusDataView.Label        = personConnectionStatusDataView.PersonConnectionStatusValue.ToString();
                dvpPersonConnectionStatusDataView.SetValue(personConnectionStatusDataView.DataViewId);
            }
        }