private void MenuItemsList_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            if (e.Item is RadListViewDataItem)
            {
                var         pageNode   = ((RadListViewDataItem)e.Item).DataItem as PageNode;
                HtmlControl listItem   = e.Item.FindControl("itemTemplateLi") as HtmlControl;
                var         childNodes = pageNode.Nodes.Where(p => p.ShowInNavigation).ToList();

                if (childNodes.Count > 0 && listItem != null)
                {
                    bool isUpperCase = false;

                    if (pageNode.Title.ToLower().Contains("products"))
                    {
                        isUpperCase = true;
                    }

                    PopulateChildItems(listItem, childNodes, isUpperCase);
                }
            }

            HyperLink logInLink = this.menuItemsList.FindControl("LogInLink") as HyperLink;

            if (logInLink != null)
            {
                this.SetButtonUrl(logInLink, this.LogInButtonLandingPage, this.LogInButtonExternalLink);
            }

            HyperLink trialLink = this.menuItemsList.FindControl("GetTrialLink") as HyperLink;

            if (trialLink != null)
            {
                this.SetButtonUrl(trialLink, this.TrialButtonLandingPage, this.TrialButtonExternalLink);
            }
        }
        protected void Repeater_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            var data        = ((RadListViewDataItem)e.Item).DataItem as BlogPost;
            var placeholder = e.Item.FindControl("tags") as SitefinityLabel;

            placeholder.Text = RenderFlatTaxaAsLink(data, "Tags");
        }
Esempio n. 3
0
 protected void RadListView1_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
 {
     if ((e.Item.ItemType == RadListViewItemType.DataItem) || (e.Item.ItemType == RadListViewItemType.AlternatingItem))
     {
         RadListViewDataItem item = e.Item as RadListViewDataItem;
         Label       lblUniq      = ((Label)item.FindControl("lblUniq"));
         ImageButton btnMore      = ((ImageButton)item.FindControl("btnMore"));
         btnMore.Attributes.Add("OnClick", "return ShowEditForm('" + lblUniq.Text.Trim() + "');");
     }
 }
Esempio n. 4
0
        private void ProductsList_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            if (e.Item is RadListViewDataItem)
            {
                HtmlControl    heading3     = e.Item.FindControl("ProductTitle") as HtmlControl;
                DynamicContent productItem  = ((RadListViewDataItem)e.Item).DataItem as DynamicContent;
                string         productTitle = String.Empty;

                if (productItem != null)
                {
                    productTitle = productItem.GetString("Title");
                }

                if (heading3 != null)
                {
                    if (productTitle.StartsWith("EU"))
                    {
                        HtmlGenericControl span = new HtmlGenericControl("span");
                        span.Attributes.Add("class", productNameSpanClass);
                        string  firstPart  = productTitle.Substring(0, 2);
                        string  secondPart = productTitle.Substring(2);
                        Literal literalEU  = new Literal();
                        literalEU.Text = firstPart;
                        heading3.Controls.Add(literalEU);

                        span.InnerText = secondPart;
                        heading3.Controls.Add(span);
                    }
                    else
                    {
                        Literal productTitleLtl = new Literal();
                        productTitleLtl.Text = productTitle;
                        heading3.Controls.Add(productTitleLtl);
                    }
                }

                //Add NavigateUrl to Policy Coverage link
                HyperLink policyCoverageLink     = e.Item.FindControl("PolicyCoverageLink") as HyperLink;
                PageNode  policyCoveragePageNode = productItem.GetValue("PolicyCoverageLandingPage") as PageNode;

                if (policyCoverageLink != null && policyCoveragePageNode != null)
                {
                    policyCoverageLink.NavigateUrl = PagesUtilities.GetPageUrlByPageNode(policyCoveragePageNode);
                }

                //Add NavigateUrl to Read More link
                HyperLink readMoreLink     = e.Item.FindControl("ReadMoreLink") as HyperLink;
                PageNode  readMorePageNode = productItem.GetValue("ReadMoreLandingPage") as PageNode;

                if (readMoreLink != null && readMorePageNode != null)
                {
                    readMoreLink.NavigateUrl = PagesUtilities.GetPageUrlByPageNode(readMorePageNode);
                }
            }
        }
Esempio n. 5
0
        protected void RadListViewImages_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            RadListViewDataItem item = e.Item as RadListViewDataItem;
            string description       = (item.DataItem as Image).Description;

            if (description.Length > 100)
            {
                description = description.Substring(0, 97) + "...";
                (item.FindControl("LabelShortDescription") as Literal).Text = description;
            }
        }
        private void JobOpeningsList_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            if (e.Item is RadListViewDataItem)
            {
                HyperLink applyNowLink = e.Item.FindControl("ApplyNowLink") as HyperLink;

                if (applyNowLink != null)
                {
                    applyNowLink.NavigateUrl = PagesUtilities.GetPageUrlById(this.ApplyNowLandingPage);
                }
            }
        }
        private void ProductsList_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            if (e.Item is RadListViewDataItem)
            {
                Repeater repeater = e.Item.FindControl("linksRepeater") as Repeater;

                if (repeater != null)
                {
                    var pageNode = ((RadListViewDataItem)e.Item).DataItem as PageNode;
                    repeater.DataSource = pageNode.Nodes;
                    repeater.DataBind();
                }
            }
        }
Esempio n. 8
0
        protected void rlv_ItemDataBound1(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            RadListViewDataItem row = e.Item as RadListViewDataItem;

            if (DataBinder.Eval(row.DataItem, "scan_document") == DBNull.Value)
            {
                return;
            }
            //HiddenField HF = (HiddenField)e.Item.FindControl("HiddenField1");
            Label  lbl     = (Label)e.Item.FindControl("lbl_Name");
            object var     = row.DataItem.ToString();
            string myValue = DataBinder.Eval(row.DataItem, "ext").ToString();
            string result  = myValue.ToLower();

            if (result.Contains("pdf"))
            {
                Button btn = (Button)e.Item.FindControl("btn_Madrak");
                btn.Visible = true;
                //HF.Value = DataBinder.Eval(row.DataItem, "doc_type").ToString();
                lbl.Text = DataBinder.Eval(row.DataItem, "document_name").ToString();
            }
            else
            {
                Button btn = (Button)e.Item.FindControl("btn_ShowPicture");
                btn.Visible = true;
                RadBinaryImage img = (RadBinaryImage)e.Item.FindControl("RadBinaryImage1");
                img.Visible = true;
                byte[] binaryData = (byte[])(DataBinder.Eval(row.DataItem, "scan_document"));
                img.DataValue = binaryData;
                //HF.Value = DataBinder.Eval(row.DataItem, "doc_type").ToString();
                lbl.Text = DataBinder.Eval(row.DataItem, "document_name").ToString();
            }

            if (DataBinder.Eval(row.DataItem, "s1").ToString() != "0")
            {
                RadioButton rdbTaeed = (RadioButton)e.Item.FindControl("rdb_Taeed");
                RadioButton rdbNaghs = (RadioButton)e.Item.FindControl("rdb_Naghs");
                TextBox     txt      = (TextBox)e.Item.FindControl("txt_Sharh");
                txt.Text = DataBinder.Eval(row.DataItem, "Description").ToString();
                if (DataBinder.Eval(row.DataItem, "s1").ToString() == "1")
                {
                    rdbTaeed.Checked = true;
                }
                else
                {
                    rdbNaghs.Checked = true;
                }
            }
        }
        private void CompaniesLogosList_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            if (e.Item is RadListViewDataItem)
            {
                var    image    = ((RadListViewDataItem)e.Item).DataItem as Telerik.Sitefinity.Libraries.Model.Image;
                string imageUrl = LibrariesUtilities.GetMediaUrlByImageId(image.Id, true);

                if (!string.IsNullOrEmpty(imageUrl))
                {
                    Image imageControl = e.Item.FindControl("logoImg") as Image;
                    imageControl.ImageUrl      = imageUrl;
                    imageControl.AlternateText = image.AlternativeText;
                }
            }
        }
Esempio n. 10
0
    protected void RadListView1_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
    {
        //EFDal ed = new EFDal();
        foreach (var item in RadListView1.Items)
        {
            Label lblDene      = item.FindControl("lblIptal") as Label;
            Panel pnlIstek1    = item.FindControl("pnl1") as Panel;
            Label lblKalTarihi = item.FindControl("lblKalTarihi") as Label;
            Label lblFatCikTar = item.FindControl("lblFatCikTar") as Label;
            Label lblGelTar    = item.FindControl("lblGelTar") as Label;
            //Label lblIstId = item.FindControl("lblIstId") as Label;


            //string bak = lblIstId.Text;
            if (lblDene.Text == "OK") //&& lblDene.Text != "")
            {
                lblDene.ForeColor   = System.Drawing.Color.Black;
                pnlIstek1.BackColor = System.Drawing.Color.LightGreen;
                //lblDene.Text = "OK";
            }
            else
            {
                lblDene.ForeColor   = System.Drawing.Color.Red;
                pnlIstek1.BackColor = System.Drawing.Color.Pink;
                //lblDene.Text = "İptal";
            }
            lblKalTarihi.Text = lblKalTarihi.Text.Replace(" 00:00:00", "");
            lblFatCikTar.Text = lblFatCikTar.Text.Replace(" 00:00:00", "");
            lblGelTar.Text    = lblGelTar.Text.Replace(" 00:00:00", "");
        }

        if (e.Item is RadListViewDataItem)
        {
            var     item     = (RadListViewDataItem)e.Item;
            string  strIstId = ((Label)item.FindControl("lblIstId")).Text;
            Control target   = e.Item.FindControl("targetControl");
            if (!Object.Equals(target, null))
            {
                if (!Object.Equals(this.RadToolTipManager1, null))
                {
                    //Add the button (target) id to the tooltip manager
                    this.RadToolTipManager1.TargetControls.Add(target.ClientID, strIstId, true);
                }
            }
        }
    }
Esempio n. 11
0
        protected void listFoods_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            if (e.Item is RadListViewDataItem)
            {
                RadListViewDataItem item = e.Item as RadListViewDataItem;

                System.Web.UI.WebControls.Button _btnRecommend = item.FindControl("btnRecommend") as System.Web.UI.WebControls.Button;
                Boolean tmp = Convert.ToBoolean(DataBinder.Eval(item.DataItem, "recommend").ToString());
                if (tmp == true)
                {
                    _btnRecommend.CssClass = "btn btn-warning";
                }
                else
                {
                    _btnRecommend.CssClass = "btn btn-light";
                }
            }
        }