Esempio n. 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
                    DataGridItem currentRow = table.Rows[i] as DataGridItem;

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

                    // raise DataGridItem Render
                    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);
        }
Esempio n. 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(DataGridItemRenderEventArgs e)
 {
     if (RowRender != null)
         RowRender(this, e);
 }