示例#1
0
        /// <summary>
        /// Renders the contents of the control into the specified writer. This method is used primarily by control developers.
        /// </summary>
        /// <param name="output"></param>
        protected override void RenderContents(HtmlTextWriter output)
        {
            if (HasControls())
            {
                // get the table from the control list
                Table table = this.Controls[0] as Table;

                for (int i = 0; i < table.Rows.Count; i++)
                {
                    // sets the row for the current data grid currentRow
                    GridViewRow currentRow = table.Rows[i] as GridViewRow;

                    // set event agruments for DataGridItem Render
                    GridViewRowRenderEventArgs args = new GridViewRowRenderEventArgs(currentRow);

                    // raise RowRender event
                    OnRowRender(args);

                    // add rows before the current row
                    foreach (TableRow row in args.RowsBeforeRow)
                        table.Rows.AddAt(i++, row);

                    // add rows after the current row
                    foreach (TableRow row in args.RowsAfterRow)
                        table.Rows.AddAt(++i, row);
                }
            }

            base.RenderContents(output);
        }
示例#2
0
 /// <summary>
 /// Fires the <see cref="OmniPortal.Components.Modules.Common.MasterDataGrid.DataGridItemRender">DataGridItemRender</see> event.
 /// </summary>
 /// <param name="e">Event Arguments.</param>
 protected virtual void OnRowRender(GridViewRowRenderEventArgs e)
 {
     if (RowRender != null)
         RowRender(this, e);
 }