Example #1
0
        protected void grid_ActionCellCustomBound(Object sender, ActionCellCustomBoundEventArgs e)
        {
            var acc = e.ActionCellControl;
            var lb  = e.ActionCellControl.FindControl("lbAction") as LinkButton;

            lb.CssClass = "button";
        }
Example #2
0
        public void OnActionCellCustomBound(ActionCellCustomBoundEventArgs args)
        {
            EventHandler <ActionCellCustomBoundEventArgs> handler = ActionCellCustomBound;

            if (handler != null)
            {
                handler(this, args);
            }
        }
Example #3
0
        public void BindActionCell(ActionCell ac, CellsListControlBase cellsList)
        {
            if (ac.Html.HasText())
            {
                ltlText.Text     = ac.Html;
                lbAction.Visible = false;
            }
            else
            {
                ltlText.Visible          = false;
                lbAction.Text            = ac.Text;
                lbAction.CommandArgument = ac.Row.Index.ToString();
                lbAction.CommandName     = ac.ActionType.ToString();

                if (ac.ActionType == ActionTypes.Edit)
                {
                    lbAction.CssClass += "button";
                    SetEditingRowMode(EditingRowMode.None, ac.Row.Index);
                }
                else if (ac.ActionType == ActionTypes.Delete)
                {
                    lbAction.CssClass += "close";

                    if (lbAction.Text.HasNoText())
                    {
                        lbAction.Text = "&times;";
                    }
                }
            }

            if (ac.Attributes != null)
            {
                AddTdHtmlTableCellAttributes(ac.Attributes);
            }

            if (ac.HideCell)
            {
                TdHtmlTableCell.Style.Add("display", "none");
            }

            CellsList = cellsList;

            if (ac.ActionType == ActionTypes.Custom)
            {
                lbCancel.Visible = false;

                var args = new ActionCellCustomBoundEventArgs(ac, this);

                CellsList.Body.GridControl.OnActionCellCustomBound(args);
            }
        }