/// <summary>
    /// OnItemDataBound event handler that ensures rendering of application list.
    /// </summary>
    /// <param name="sender">Sender object</param>
    /// <param name="item">Bound item</param>
    protected void appListUniview_OnItemDataBound(object sender, UniViewItem item)
    {
        DataRowView drv = item.DataItem as DataRowView;

        if (drv != null)
        {
            int level = ValidationHelper.GetInteger(drv["ElementLevel"], -1);
            bool isCategory = (level == 2);

            // Set placeholder based by category or application
            String placeholderId = isCategory ? "plcCategoryTemplate" : "plcItemTemplate";

            // If current item is category then make visible appropriate placeholder to render category template. Otherwise make visible placeholder that renders item template
            Control c = item.FindControl(placeholderId);
            if (c != null)
            {
                c.Visible = true;
            }
        }
    }
Beispiel #2
0
    /// <summary>
    /// OnItemDataBound event handler that ensures rendering of application list.
    /// </summary>
    /// <param name="sender">Sender object</param>
    /// <param name="item">Bound item</param>
    protected void appListUniview_OnItemDataBound(object sender, UniViewItem item)
    {
        DataRowView drv = item.DataItem as DataRowView;

        if (drv != null)
        {
            int  level      = ValidationHelper.GetInteger(drv["ElementLevel"], -1);
            bool isCategory = (level == 2);

            // Set placeholder based by category or application
            String placeholderId = isCategory ? "plcCategoryTemplate" : "plcItemTemplate";

            // If current item is category then make visible appropriate placeholder to render category template. Otherwise make visible placeholder that renders item template
            Control c = item.FindControl(placeholderId);
            if (c != null)
            {
                c.Visible = true;
            }
        }
    }