or
SelectCommand="SELECT Appointments.ID, Appointments.Subject, Appointments.Description, Appointments.Start, Appointments.RoomID, Appointments.UserID, Appointments.RecurrenceRule, Appointments.[End], Appointments.Annotations, Appointments.Reminder, Appointments.RecurrenceParentID, Rooms.ID AS Expr1, Rooms.RoomName as rName FROM Appointments INNER JOIN Rooms ON Appointments.RoomID = Rooms.ID"<asp:Literal ID="AppointmentLocation" runat="server" Text='<%# Eval("rName") %>'></asp:Literal>
Line 30: |


protected void Page_Init() { ConfigureGrid(); } private void ConfigureGrid() { try { OrderTypeRankingGrid.AddNeedDataSourceEventHandler(NeedDataSource); OrderTypeRankingGrid.AddGridCommandEventHandler(DataGrid_ItemCommand); OrderTypeRankingGrid.PreRender += new EventHandler(OrderTypeRankingGrid_PreRender); OrderTypeRankingGrid.AllowColumnsReorder = false; OrderTypeRankingGrid.GridHeaderText = "Order Type Ranking"; var masterView = OrderTypeRankingGrid.ConfigureMasterTableView("vDivisionOrderTypeRanking", new string[] { "DivisionOrderTypeRankId","CategoryCode", "PurposeCode", "ReasonCode", "ReasonDescription"}); masterView.AllowFilteringByColumn = true; masterView.AllowSorting = true; masterView.FullEditMode = true; masterView.EditMode = GridEditMode.InPlace; masterView.EnableShowHideColumns = true; masterView.SetPaging(GridPagerMode.NextPrevAndNumeric); masterView.GridTableView.ShowHeader = true; masterView.ShowHeader = true; masterView.ShowFooter = true; masterView.ShowHeadersWhenNoRecords = true; masterView.AllowPaging = true; //masterView.PageSize = 50; masterView.AddNgmCommandButton(NgmButtonType.Save, "btnSave", null, null, null, Unit.Pixel(50)); masterView.AddNgmCommandButton(NgmButtonType.Cancel, "btnCancel", null, null, null, Unit.Pixel(50)); masterView.CommandItemDisplay = GridCommandItemDisplay.Bottom; if (!IsPostBack) //must check for postback; otherwise, columns will be duplicated { masterView.AddBoundColumn("CategoryCode", "Category Code", "CategoryCode", true, false, true, Unit.Percentage(7.0)); masterView.AddBoundColumn("PurposeCode", "Purpose Code", "PurposeCode", true, false, true, Unit.Percentage(7.0)); masterView.AddBoundColumn("ReasonCode", "Reason Code", "ReasonCode", true, false, true, Unit.Percentage(7.0)); masterView.AddBoundColumn("ReasonDescription", "Reason Description", "ReasonDescription", true, false, true, Unit.Percentage(7.0)); masterView.AddNumericColumn("OrderTypeRank", "Rank", "OrderTypeRank", false, false, true, Unit.Percentage(7.0), typeof(int),NumericType.Number,"{0:N0}", 10); } } catch (System.Exception ex) { base.AddException(ex); } } protected void OrderTypeRankingGrid_PreRender(object sender, EventArgs e) { if (IsPostBack) { for (int i = 0; i < OrderTypeRankingGrid.PageCount; i++) { OrderTypeRankingGrid.EditIndexes.Add(i); } OrderTypeRankingGrid.Rebind(); } } protected void NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { try { if (IsPostBack) { if (!e.IsFromDetailTable && (this.productDivision == 1 || this.productDivision == 2)) { productDivision = long.Parse(cboxDivision.SelectedValue.ToString()); IDivisionOrderTypeRankService divisionOrderTypeRankServiceAgent = null; divisionOrderTypeRankServiceAgent = (IDivisionOrderTypeRankService)ContextRegistry.GetContext().GetObject("DivisionOrderTypeRankServiceAgent"); IList<DivisionOrderTypeRankDTO> divisionOrderTypeRankDTOs = divisionOrderTypeRankServiceAgent.GetDivisionOrderTypeRankByDivision(productDivision); if (divisionOrderTypeRankDTOs.Count > 1) { var divOrderTypeRankDTOstemp = from b in divisionOrderTypeRankDTOs orderby b.CategoryCode ascending, b.PurposeCode ascending, (b.OrderTypeRank == null ? int.MaxValue : b.OrderTypeRank) ascending select b; OrderTypeRankingGrid.DataSource = divOrderTypeRankDTOstemp; } else { base.AddWarning("There are no records to display"); } } } } catch (System.Exception ex) { base.AddException(ex); } }

