protected void Display_View_All() { Ektron.Cms.Common.Criteria<WarehouseProperty> warehouseCriteria = new Ektron.Cms.Common.Criteria<WarehouseProperty>(WarehouseProperty.Name, Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending); System.Collections.Generic.List<WarehouseData> WarehouseList = new System.Collections.Generic.List<WarehouseData>(); int i = 0; m_refWarehouse = new WarehouseApi(); dg_warehouse.AutoGenerateColumns = false; dg_warehouse.Columns.Clear(); warehouseCriteria.PagingInfo.RecordsPerPage = m_refContentApi.RequestInformationRef.PagingSize; warehouseCriteria.PagingInfo.CurrentPage = _currentPageNumber; WarehouseList = m_refWarehouse.GetList(warehouseCriteria); TotalPagesNumber = System.Convert.ToInt32(warehouseCriteria.PagingInfo.TotalPages); if (TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { lnkBtnPreviousPage.Enabled = true; FirstPage.Enabled = true; LastPage.Enabled = true; NextPage.Enabled = true; TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDouble(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_currentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; FirstPage.Enabled = false; } else if (_currentPageNumber == TotalPagesNumber) { NextPage.Enabled = false; LastPage.Enabled = false; } } System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Radio"; colBound.HeaderText = ""; colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; dg_warehouse.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "Name"; colBound.HeaderText = this.GetMessage("generic name"); colBound.ItemStyle.Wrap = false; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Left; dg_warehouse.Columns.Add(colBound); colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "ID"; colBound.HeaderText = this.GetMessage("generic id"); colBound.ItemStyle.Wrap = false; colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; dg_warehouse.Columns.Add(colBound); dg_warehouse.BorderColor = System.Drawing.Color.White; colBound = new System.Web.UI.WebControls.BoundColumn(); colBound.DataField = "IsDefaultWarehouse"; colBound.HeaderText = this.GetMessage("lbl default"); colBound.ItemStyle.Wrap = false; colBound.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; colBound.ItemStyle.VerticalAlign = VerticalAlign.Top; colBound.ItemStyle.HorizontalAlign = HorizontalAlign.Center; dg_warehouse.Columns.Add(colBound); dg_warehouse.BorderColor = System.Drawing.Color.White; DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add(new DataColumn("Radio", typeof(string))); dt.Columns.Add(new DataColumn("Name", typeof(string))); dt.Columns.Add(new DataColumn("Id", typeof(string))); dt.Columns.Add(new DataColumn("IsDefaultWarehouse", typeof(string))); if (!(WarehouseList == null)) { for (i = 0; i <= WarehouseList.Count - 1; i++) { m_bIsDefault = System.Convert.ToBoolean(WarehouseList[i].IsDefaultWarehouse); dr = dt.NewRow(); dr[0] = "<input type=\"radio\" id=\"radio_warehouse\" name=\"radio_warehouse\" value=\"" + WarehouseList[i].Id + "\" />"; dr[1] = "<a href=\"shippingsource.aspx?action=View&id=" + WarehouseList[i].Id + "\">" + WarehouseList[i].Name + "</a>"; dr[2] = "<label id=\"lbl_warehouseId\">" + WarehouseList[i].Id + "</label>"; dr[3] = "<input type=\"CheckBox\" id=\"chk_default" + i + "\" name=\"chk_default" + i + "\" disabled=\"true\" " + (m_bIsDefault ? "Checked=\"checked\"" : "") + "/>"; dt.Rows.Add(dr); } } DataView dv = new DataView(dt); dg_warehouse.DataSource = dv; dg_warehouse.DataBind(); }