Esempio n. 1
0
 /// <summary>
 /// If client sorting is enabled, we generate the custom column attribute. The value of this attribute
 /// is the column index. It is generated only for those columns which should be sortable.
 /// </summary>
 /// <param name="writer"></param>
 protected override void Render(HtmlTextWriter writer)
 {
     base.Render(writer);
     if (_newRow != null)
     {
         //_newRow.CssClass = "ui-widget-header";
         _newRow.Page = this.Page;
         _newRow.RenderControl(writer);
     }
 }
Esempio n. 2
0
        protected override void Render(HtmlTextWriter writer)
        {
            //render header row
            writer.Write("<table  border='0' cellspacing='" + this.CellSpacing.ToString() + "' cellpadding='" + this.CellPadding.ToString() + "' style='width:" + CalculateWidth() + "'>");
            GridViewRow customHeader = this.HeaderRow;

            if (this.HeaderRow != null)
            {
                customHeader.ApplyStyle(this.HeaderStyle);
                if (AutoGenerateColumns == false)
                {
                    int i = 0;
                    foreach (DataControlField col in this.Columns)
                    {
                        customHeader.Cells[i].ApplyStyle(col.HeaderStyle);
                        i++;
                    }
                }

                customHeader.RenderControl(writer);
                this.HeaderRow.Visible = false;
            }
            writer.Write("</table>");

            //render data rows
            writer.Write("<div id='" + ClientID + "_div'  style='" +
                         "padding-bottom:5px;overflow-x:hidden;overflow-y:scroll;" +

                         "width:" + CalculateWidth() + ";" +
                         "height:" + CalculateHeight() + ";" +
                         "background-color:#FFFFFF;'>");

            //get the pager row and make invisible
            GridViewRow customPager = this.BottomPagerRow;

            if (this.BottomPagerRow != null)
            {
                this.BottomPagerRow.Visible = false;
            }


            base.Render(writer);
            writer.Write("</div>");

            //render pager row
            if (customPager != null && this.PageCount > 0)
            {
                writer.Write("<table  border='0' cellspacing='" + this.CellSpacing.ToString() + "' cellpadding='" + this.CellPadding.ToString() + "' style='width:" + CalculateWidth() + "'>");
                customPager.ApplyStyle(this.PagerStyle);
                customPager.Visible = true;
                customPager.RenderControl(writer);
                writer.Write("</table>");
            }
        }