Adf.Web.UI.SmartView.SmartView.CreateEmptyRow C# (CSharp) Method

CreateEmptyRow() private method

private CreateEmptyRow ( ) : void
return void
        private void CreateEmptyRow()
        {
            //create table
            var table = new Table { ID = ID };

            //create a new header row
            var row = CreateRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal);

            //convert the exisiting columns into an array and initialize
            var fields = new DataControlField[Columns.Count];

            Columns.CopyTo(fields, 0);
            InitializeRow(row, fields);
            table.Rows.Add(row);

            if (EmptyDataTemplate != null || !string.IsNullOrEmpty(EmptyDataText))
            {
                var emptyRow = new GridViewRow(-1, -1, DataControlRowType.EmptyDataRow, DataControlRowState.Normal) { CssClass = "SmartViewRow"};
                var cell = new TableCell { ColumnSpan = fields.Length };

                if (EmptyDataTemplate != null)
                {
                    EmptyDataTemplate.InstantiateIn(cell);
                }
                else
                {
                    cell.Controls.Add(new LiteralControl(ResourceManager.GetString(EmptyDataText)));
                }

                emptyRow.Cells.Add(cell);
                table.Rows.Add(emptyRow);
            }

            Controls.Clear(); // Remove the current empty row and stuff
            Controls.Add(table);
        }