Esempio n. 1
0
    protected void Grid1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {

            var item = new AttributeSet();
            item = (AttributeSet)e.Row.DataItem;

            LinkButton LnkTitle = (LinkButton)e.Row.FindControl("LnkTitle");
            LnkTitle.Text = "<i class='fa fa-pgn_edit fa-fw'></i>";
            LnkTitle.Text += Utility.Html.GetTextPreview(item.Name, 50, "");
            if (string.IsNullOrEmpty(LnkTitle.Text))
                LnkTitle.Text += Utility.GetLabel("NO_VALUE", "<no value>");
            if (Roles.IsUserInRole("debug"))
                LnkTitle.Text += " [" + item.Id.ToString() + "]";

            // Get all selected attributes
            string selectedAttributes = "";
            var aman = new AttributesManager();
            foreach (var attributeId in item.AttributesList)
            {
                selectedAttributes += " - <i>" + aman.GetByKey(attributeId).Name  + "<i>";
            }

            selectedAttributes = selectedAttributes.Substring(2);

            Literal LitAttributesSelected = (Literal)e.Row.FindControl("LitAttributesSelected");
            LitAttributesSelected.Text = selectedAttributes;

        }
    }