Adf.Web.UI.SmartView.BaseButton.InitializeCell C# (CSharp) Méthode

InitializeCell() public méthode

public InitializeCell ( System.Web.UI.WebControls.DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex ) : void
cell System.Web.UI.WebControls.DataControlFieldCell
cellType DataControlCellType
rowState DataControlRowState
rowIndex int
Résultat void
        public override void InitializeCell(DataControlFieldCell cell, DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
        {
            base.InitializeCell(cell, cellType, rowState, rowIndex);

            if (ColumnStyle != null)
            {
                if (HeaderStyle.CssClass.IsNullOrEmpty()) HeaderStyle.CssClass = ColumnStyle;
                if (ItemStyle.CssClass.IsNullOrEmpty()) ItemStyle.CssClass = ColumnStyle;
                if (FooterStyle.CssClass.IsNullOrEmpty()) FooterStyle.CssClass = ColumnStyle;
            }
            if (Width != null) ItemStyle.Width = Unit.Parse(Width);
            if (CommandName.IsNullOrEmpty()) CommandName = "Select";

            if (cellType == DataControlCellType.DataCell && !tooltip.IsNullOrEmpty()) cell.ToolTip = tooltip;

            var control = cell.Controls.Cast<Control>().OfType<IButtonControl>().OfType<Control>().FirstOrDefault();

            if (control != null)
            {
                // workaround: ButtonField.InitializeCell add handler OnDataBindField which tries to get DataField from DataItem
                RemoveEventHandlers(control, "DataBinding");
            }
            cell.DataBinding += ItemDataBinding;
        }