コード例 #1
0
        /// <summary>
        /// Handles the RowDataBound event of the gAttendees control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="GridViewRowEventArgs"/> instance containing the event data.</param>
        protected void gAttendees_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }

            RosterAttendee attendee = e.Row.DataItem as RosterAttendee;

            var lPhoto = e.Row.FindControl("lPhoto") as Literal;

            lPhoto.Text = attendee.GetPersonPhotoImageHtmlTag();
            var lName = e.Row.FindControl("lName") as Literal;

            lName.Text = attendee.GetAttendeeNameHtml();

            var lGroupNameAndPath = e.Row.FindControl("lGroupNameAndPath") as Literal;

            if (lGroupNameAndPath != null && lGroupNameAndPath.Visible)
            {
                if (_showOnlyParentGroup)
                {
                    lGroupNameAndPath.Text = lGroupNameAndPath.Text = attendee.GetParentGroupNameAndPathHtml();
                }
                else
                {
                    lGroupNameAndPath.Text = lGroupNameAndPath.Text = attendee.GetGroupNameAndPathHtml();
                }
            }

            var lLocation = e.Row.FindControl("lLocation") as Literal;

            lLocation.Text = attendee.RoomName;
        }
コード例 #2
0
        /// <summary>
        /// Handles the RowDataBound event of the gAttendees control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="GridViewRowEventArgs"/> instance containing the event data.</param>
        protected void gAttendees_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }

            RosterAttendee attendee = e.Row.DataItem as RosterAttendee;

            // Desktop only.
            var lPhoto = e.Row.FindControl("lPhoto") as Literal;

            lPhoto.Text = attendee.GetPersonPhotoImageHtmlTag();

            // Mobile only.
            var lMobileIcon = e.Row.FindControl("lMobileIcon") as Literal;

            lMobileIcon.Text = attendee.GetStatusIconHtmlTag(true);

            // Shared between desktop and mobile.
            var lName = e.Row.FindControl("lName") as Literal;

            lName.Text = attendee.GetAttendeeNameHtml();

            // Desktop only.
            var lBadges = e.Row.FindControl("lBadges") as Literal;

            lBadges.Text = string.Format("<div>{0}</div>", attendee.GetBadgesHtml(_attributesForAlertIcons));

            // Mobile only.
            var lMobileTagAndSchedules = e.Row.FindControl("lMobileTagAndSchedules") as Literal;

            lMobileTagAndSchedules.Text = attendee.GetMobileTagAndSchedulesHtml();

            // Desktop only.
            var lStatusTag = e.Row.FindControl("lStatusTag") as Literal;

            lStatusTag.Text = attendee.GetStatusIconHtmlTag(false);
        }