Add a new property AllowSelection/EnableSelection in order to control whether the use can select a cell/row. Workaround: Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.ProductsTableAdapter.Fill(Me.NwindDataSet.Products) Me.RadGridView1.CurrentRow = Nothing AddHandler Me.RadGridView1.SelectionChanging, AddressOf Grid_SelectionChanging AddHandler Me.RadGridView1.CurrentRowChanging, AddressOf Grid_CurrentRowChanging End Sub Private Sub Grid_SelectionChanging(sender As Object, e As Telerik.WinControls.UI.GridViewSelectionCancelEventArgs) e.Cancel = True End Sub Private Sub Grid_CurrentRowChanging(sender As Object, e As Telerik.WinControls.UI.CurrentRowChangingEventArgs) e.Cancel = True End Sub
To reproduce: if (e.CellElement.ColumnInfo.HeaderText == "CategoryID") { e.CellElement.DrawText = false; } else { e.CellElement.ResetValue(LightVisualElement.DrawTextProperty, ValueResetFlags.Local); } Workaround: e.CellElement.DrawText = true;
Hi, Following to the workaroud (flag IsSearchAsync) provided (https://feedback.telerik.com/Project/154/Feedback/Details/245938-fix-radgridview-having-groups-filters-sort-descriptors-and-search-query-in-t), we discovered two issues : 1) the behavior of the grid is changed while using IsSearchAsync as true or false (see 2018-08-01_1849_DragDrop_behavior_with_IsSearchAsync.swf video attached). When set to true, the line found by the searchbox is automatically reselected. When the flag is set to false, it's not the case. 2) while playing with drag&drop, after some time the grid became unstable (see 2018-08-01_1847_-_dragdrop_issue_with_IsAsyncSearch.swf video attached). You can see that at the beginning, the D&D works fine. At 0:20 I can't select any line, and when I try to D&D, it drops always the same customer. At 0:40 you can see that even the SearchBox is broken and the progressbar is looping forever
Hi, We got an issue comparable to the one already described (see 245938), using the same demo project 1) I add LastDeliveryDateTimeLocal column 2) remove groups 3) click on "Start async notifications" 4) click on the filter icon next to "LastDeliveryDateTimeLocal" column name 5) uncheck some values (08/09/2016, 11/11/2016, 03/01/2017) 6) click Ok => NullReferenceException
Use attached to reproduce. Workaround: class MySpreadExportRenderer : SpreadExportRenderer { public override void SetWorksheetColumnWidth(int columnIndex, double value, bool isCustom) { if (value > 2000) { value = 2000; } base.SetWorksheetColumnWidth(columnIndex, value, isCustom); } }
how can i insert , update or delete? i tried after choosing the data source , it shows the data correctly but when i edit or add a new item the database is not affected (allow edit,delete and add row are set to true)
How to reproduce: check the attached project and comment the workaround Workaround: public partial class RadForm1 : Telerik.WinControls.UI.RadForm { private BindingList<TestDataObject> data; public RadForm1() { InitializeComponent(); this.data = new BindingList<TestDataObject>(); this.LoadData(); GridViewTextBoxColumn textColumn = new GridViewTextBoxColumn(); textColumn.Name = "Name"; textColumn.FieldName = "Name"; textColumn.HeaderText = "Name"; this.radGridView1.Columns.Add(textColumn); GridViewDateTimeColumn dateColumn = new GridViewDateTimeColumn(); dateColumn.Name = "Date"; dateColumn.FieldName = "Date"; dateColumn.HeaderText = "Date"; this.radGridView1.Columns.Add(dateColumn); GridViewMaskBoxColumn maskBoxColumn = new GridViewMaskBoxColumn(); maskBoxColumn.Name = "Price"; maskBoxColumn.FieldName = "Price"; maskBoxColumn.HeaderText = "Price"; maskBoxColumn.MaskType = MaskType.Numeric; maskBoxColumn.Mask = "C"; maskBoxColumn.TextAlignment = ContentAlignment.BottomRight; maskBoxColumn.FormatString = "{0:C}"; maskBoxColumn.DataType = typeof(decimal); this.radGridView1.Columns.Add(maskBoxColumn); this.radGridView1.DataSource = this.data; this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; //Workaround this.radGridView1.CellBeginEdit += RadGridView1_CellBeginEdit; this.radGridView1.EditorRequired += RadGridView1_EditorRequired; } void RadGridView1_EditorRequired(object sender, EditorRequiredEventArgs e) { if (e.EditorType == typeof(RadMaskedEditBoxEditor)) { e.EditorType = typeof(MyRadMaskedEditBoxEditor); } } private void RadGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) { RadMaskedEditBoxEditor maskedEditBoxEditor = e.ActiveEditor as RadMaskedEditBoxEditor; if (maskedEditBoxEditor != null && e.Row.Cells[e.ColumnIndex].Value == null) { maskedEditBoxEditor.MaskTextBox.EnableNullValueInput = true; } else { maskedEditBoxEditor.MaskTextBox.EnableNullValueInput = false; } } private void LoadData() { for (int i = 0; i < 1000; i++) { decimal? price = null; if (i % 2 == 0) { price = i * 100; } this.data.Add(new TestDataObject { Name = "Name " + i, Date = DateTime.Now.AddDays(i), Price = price }); } } } public class TestDataObject { public string Name { get; set; } public DateTime Date { get; set; } public decimal? Price { get; set; } } public class MyRadMaskedEditBoxEditor : RadMaskedEditBoxEditor { public override object Value { get { return base.Value; } set { if (value == null && (this.MaskTextBox.EnableNullValueInput || this.MaskTextBox.MaskType != MaskType.Numeric)) { this.MaskTextBox.Value = this.NullValue; } else { base.Value = value; } } } }
Hello, Please create a GridViewDateTimeOffsetColumn to support DateTimeOffset type. A datetimeoffset editor would be good and support of nullable date types. Thank you!
To reproduce: please refer to the attached gif file illustrating the steps how to reproduce the problem with the Demo application. Workaround: private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) { GridDataCellElement cell = e.CellElement as GridDataCellElement; if (cell != null) { if (cell.ContainsErrors) { cell.DrawBorder = true; cell.BorderBoxStyle = BorderBoxStyle.FourBorders; cell.BorderBottomColor = cell.BorderTopColor = cell.BorderRightShadowColor = cell.BorderLeftShadowColor = Color.Transparent; cell.BorderBottomShadowColor = cell.BorderTopShadowColor = cell.BorderRightColor = cell.BorderLeftColor = Color.Red; cell.BorderBottomWidth = cell.BorderTopWidth = cell.BorderRightWidth = cell.BorderLeftWidth = 1; cell.BorderDrawMode = BorderDrawModes.HorizontalOverVertical; cell.ZIndex = 2; } else { cell.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderBoxStyleProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderBottomColorProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderBottomShadowColorProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderBottomWidthProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderTopColorProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderTopShadowColorProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderTopWidthProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderLeftColorProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderLeftShadowColorProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderLeftWidthProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.BorderDrawModeProperty, ValueResetFlags.Local); cell.ResetValue(LightVisualElement.ZIndexProperty, ValueResetFlags.Local); } } }
Use attached to reproduce. - Use a 125% and 150% monitor for reproducing. - This should be tested on Windows 10 1803 (Spring Update) as well. Workaround: private void RadGridView1_ColumnChooserCreated(object sender, Telerik.WinControls.UI.ColumnChooserCreatedEventArgs e) { e.ColumnChooser = new MyColumnChooser(this.radGridView1.MasterTemplate, radGridView1.GridViewElement); } public partial class MyColumnChooser : GridViewColumnChooser { public MyColumnChooser() { InitializeComponent(); } public MyColumnChooser(GridViewTemplate template, RadGridViewElement rootElement) : base(template, rootElement) { } SizeF oldDpi = new SizeF(1, 1); protected override void HandleDpiChanged() { base.HandleDpiChanged(); SizeF descale = new SizeF(1f / this.FormElement.DpiScaleFactor.Width, 1f / this.FormElement.DpiScaleFactor.Height); this.Scale(descale); var dpi = NativeMethods.GetMonitorDpi(Screen.FromRectangle(this.Bounds), NativeMethods.DpiType.Effective); if (oldDpi != dpi) { SizeF sz = new SizeF(dpi.Width / oldDpi.Width, dpi.Height / oldDpi.Height); this.Scale(dpi); } oldDpi = dpi; } }
To reproduce: please refer to the attached sample gif file. Note that it is important that the child template is bound at design time and the columns are automatically generated. Workaround: setup the ViewDefinition programmatically:
Use attached to reproduce. Workaround: private void RadGridView1_ColumnChooserCreated(object sender, Telerik.WinControls.UI.ColumnChooserCreatedEventArgs e) { var columnChooser = e.ColumnChooser as GridViewColumnChooser; columnChooser.Shown -= ColumnChooser_Shown; columnChooser.Shown += ColumnChooser_Shown; } private void ColumnChooser_Shown(object sender, EventArgs e) { var columnChooser = sender as GridViewColumnChooser; var factor = this.FormElement.DpiScaleFactor; columnChooser.Scale(factor); }
To reproduce: please refer to the attached sample project and gif file. Workaround: add the column programmatically, not at design time.
How to reproduce: public partial class RadForm1 : Telerik.WinControls.UI.RadForm { public RadForm1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; GridViewDecimalColumn decimalColumn = this.radGridView1.Columns[0] as GridViewDecimalColumn; decimalColumn.DecimalPlaces = 2; decimalColumn.FormatString = "{0:N2}"; decimalColumn.ExcelExportType = DisplayFormatType.Custom; decimalColumn.ExcelExportFormatString = "0.000"; } public object GridViewSpreaExport { get; private set; } private object GetData() { DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(double)); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Bool", typeof(bool)); dt.Columns.Add("Date", typeof(DateTime)); for (int i = 0; i < 100; i++) { dt.Rows.Add(1.10 + i, "Name " + i, i % 2 == 0, DateTime.Now.AddDays(i)); } return dt; } private void radButton1_Click(object sender, EventArgs e) { GridViewSpreadStreamExport spreadExporter = new GridViewSpreadStreamExport(this.radGridView1); spreadExporter.FileExportMode = FileExportMode.CreateOrOverrideFile; SpreadStreamExportRenderer renderer1 = new SpreadStreamExportRenderer(); spreadExporter.RunExportAsync(@"..\..\exported-stream.xlsx", renderer1); } } Workaround: Create a custom SpreadStreamExportRenderer public class CustomSpreadStreamExportRenderer : SpreadStreamExportRenderer { public override void SetCellValue(DataType dataType, object value) { switch (dataType) { case DataType.Number: this.SetNumberValue(value); break; case DataType.DateTime: this.SetDateTimeValue(value); break; case DataType.Boolean: this.SetBooleanValue(value); break; case DataType.Other: if (this.SetNumberValue(value)) { break; } if (this.SetDateTimeValue(value)) { break; } if (this.SetBooleanValue(value)) { break; } this.SetStringValue(value); break; case DataType.String: default: this.SetStringValue(value); break; } } }
To reproduce: run the attached sample project. Type "res" in the search box very very fast. You will notice that the results with starting with "re" are highlighted. Note: it is usually reproducible the first serahc after loading the form.
To reproduce: set Excel-like filter according to the online documentation: https://docs.telerik.com/devtools/winforms/gridview/filtering/setting-filters-programmatically-(composite-descriptors) this.radGridView1.DataSource = this.productsBindingSource; this.productsTableAdapter.Fill(this.nwindDataSet.Products); this.radGridView1.EnableFiltering = true; this.radGridView1.ShowHeaderCellButtons = true; var filterDescriptor = new FilterDescriptor(); filterDescriptor.PropertyName = "UnitsInStock"; filterDescriptor.Value = 101; filterDescriptor.Operator = FilterOperator.IsEqualTo; var filterDescriptor2 = new FilterDescriptor(); filterDescriptor2.PropertyName = "UnitsInStock"; filterDescriptor2.Value = 104; filterDescriptor2.Operator = FilterOperator.IsEqualTo; var cfd = new CompositeFilterDescriptor(); cfd.LogicalOperator = FilterLogicalOperator.Or; cfd.FilterDescriptors.Add(filterDescriptor); cfd.FilterDescriptors.Add(filterDescriptor2); cfd.IsFilterEditor = true; this.radGridView1.FilterDescriptors.Add(cfd); this.radGridView1.MasterTemplate.ExcelFilteredColumns.Add(this.radGridView1.Columns["UnitsInStock"]); You will notice that the filter popup contains all possible values for this column which is OK, but none of the nodes is checked. It is necessary the visible rows to be checked. Workaround: check the nodes programmatically when the popup is shown: private void radGridView1_FilterPopupInitialized(object sender, Telerik.WinControls.UI.FilterPopupInitializedEventArgs e) { RadListFilterPopup popup = e.FilterPopup as RadListFilterPopup; if (popup!=null) { popup.Tag = e.Column.Name; popup.PopupOpened-=popup_PopupOpened; popup.PopupOpened+=popup_PopupOpened; } } private void popup_PopupOpened(object sender, EventArgs args) { RadListFilterPopup popup = sender as RadListFilterPopup; foreach (GridViewRowInfo row in this.radGridView1.ChildRows) { RadTreeNode node= popup.MenuTreeElement.TreeView.FindNodes(row.Cells[popup.Tag+""].Value.ToString()).FirstOrDefault(); if (node!=null) { node.Checked = true; } } }
To reproduce: please refer to the attached sample project and gif file Workaround: GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1); spreadExporter.ExportFormat = SpreadExportFormat.Pdf; spreadExporter.ExportVisualSettings = true; SpreadExportRenderer exportRenderer = new SpreadExportRenderer(); spreadExporter.RunExport(exportFile, exportRenderer); Process.Start(exportFile);
To reproduce: add a grid and a button and use the following code snippet: [WORKAROUND: call Application.DoEvent at the beginning of the BindGrid method before rebinding] public partial class Form1 : Form { DataTable dtLeg; DataTable dtComp; DataTable dtClass; Int32 intClickCount = 0; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { try { BindTables(); } catch(Exception) { throw; } } private void BindTables() { try { dtLeg = new DataTable(); dtComp = new DataTable(); dtClass = new DataTable(); Random rand1 = new Random(); Random rand2 = new Random(); Random rand3 = new Random(); Random rand4 = new Random(); int cNo = rand1.Next(2000, 10000); int dID = rand2.Next(2000, 10000); int dDetID = rand3.Next(2000, 10000); int depCode = rand4.Next(1000, 8000); string cCls = "Leg MIAGCM " + depCode.ToString(); dtLeg.Columns.Add("Case_Number"); dtLeg.Columns.Add("Departure_Detail_Id"); dtLeg.Columns.Add("Departure_Id"); dtLeg.Columns.Add("Cabin_Class"); dtLeg.Columns.Add("Leg_Segment_type"); dtLeg.Columns.Add("Departure_Detail_Capture_Id"); dtLeg.Columns.Add("DDC_Compartment_Id"); dtLeg.Columns.Add("Compartment_Structure_Id"); dtLeg.Columns.Add("Compartment_Name"); dtLeg.Columns.Add("Compartment_id"); dtLeg.Columns.Add("DDC_Class_Id"); dtLeg.Columns.Add("Class_Structure_Id"); dtLeg.Columns.Add("Class_Name"); dtLeg.Columns.Add("Class_id"); dtLeg.Columns.Add("DDC_Subclass_Id"); dtLeg.Columns.Add("Subclass_Structure_Id"); dtLeg.Columns.Add("Subclass_Name"); dtLeg.Columns.Add("Subclass_id"); dtLeg.Columns.Add("Adjusted_Authorizations"); dtLeg.Columns.Add("Adjusted_Availability"); dtLeg.Columns.Add("Adjusted_Bid_Price"); dtLeg.Columns.Add("Adjusted_Boardings"); dtLeg.Columns.Add("Adjusted_Bookings"); dtLeg.Columns.Add("Adjusted_Load_Factor"); dtLeg.Columns.Add("Adjusted_Physical_Load_Factor"); dtLeg.Columns.Add("Adjusted_Revenue_Gain"); dtLeg.Columns.Add("Adjusted_SCI"); dtLeg.Columns.Add("Authorized_Capacity"); dtLeg.Columns.Add("Average_Fare_Value"); dtLeg.Columns.Add("Booked_Costs"); dtLeg.Columns.Add("Booked_Revenue"); dtLeg.Columns.Add("Class_Usage_Ratio"); dtLeg.Columns.Add("Confidence"); dtLeg.Columns.Add("Current_Authorizations"); dtLeg.Columns.Add("Current_Availability"); dtLeg.Columns.Add("Current_Bookings"); dtLeg.Columns.Add("Current_SCI"); dtLeg.Columns.Add("Go_Shows"); dtLeg.Columns.Add("Group_Bookings"); dtLeg.Columns.Add("Group_No_Show_Percentage"); dtLeg.Columns.Add("Limit_Compartment"); dtLeg.Columns.Add("Max_Constraint_Type"); dtLeg.Columns.Add("Maximum_Authorizations_Constraint"); dtLeg.Columns.Add("Maximum_Leg_Authorization"); dtLeg.Columns.Add("Min_Constraint_Type"); dtLeg.Columns.Add("Minimum_Authorizations_Constraint"); dtLeg.Columns.Add("No_Show_Percentage"); dtLeg.Columns.Add("No_Shows"); dtLeg.Columns.Add("Overbooking_Amount"); dtLeg.Columns.Add("Overbooking_Cost"); dtLeg.Columns.Add("Physical_Capacity"); dtLeg.Columns.Add("Projected_Authorized_Load_Factor"); dtLeg.Columns.Add("Projected_Boardings"); dtLeg.Columns.Add("Projected_Bookings"); dtLeg.Columns.Add("Projected_Physical_Load_Factor"); dtLeg.Columns.Add("Projected_Revenue"); dtLeg.Columns.Add("Recommended_Authorized_Load_Factor"); dtLeg.Columns.Add("Recommended_Authorizations"); dtLeg.Columns.Add("Recommended_Availability"); dtLeg.Columns.Add("Recommended_Bid_Price"); dtLeg.Columns.Add("Recommended_Boardings"); dtLeg.Columns.Add("Recommended_Bookings"); dtLeg.Columns.Add("Recommended_Physical_Load_Factor"); dtLeg.Columns.Add("Recommended_Revenue"); dtLeg.Columns.Add("Recommended_Revenue_Gain"); dtLeg.Columns.Add("Recommended_SCI"); dtLeg.Columns.Add("Remaining_Cancellations"); dtLeg.Columns.Add("Original_Demand"); dtLeg.Columns.Add("Remaining_Demand"); dtLeg.Columns.Add("Revenue_Target"); dtLeg.Columns.Add("Standard_Deviation"); dtLeg.Columns.Add("Theoretical_Capacity"); dtLeg.Columns.Add("Total_Booked_Costs"); dtLeg.Columns.Add("Total_Booked_Revenue"); dtLeg.Columns.Add("Total_Group_Bookings"); dtLeg.Columns.Add("Total_Projected_Demand"); dtLeg.Columns.Add("Total_Waitlist"); dtLeg.Columns.Add("Unit_Target"); dtLeg.Columns.Add("Upsell_Adjusted_Demand"); dtLeg.Columns.Add("Upsell_Authorizations"); dtLeg.Columns.Add("Upsell_Availability"); dtLeg.Columns.Add("Upsell_Boardings"); dtLeg.Columns.Add("Upsell_Bookings"); dtLeg.Columns.Add("Upsell_Probability"); dtLeg.Columns.Add("Upsell_Revenue"); dtLeg.Columns.Add("Upsell_Revenue_Gain"); dtLeg.Columns.Add("Upsell_SCI"); dtLeg.Columns.Add("Upsell_Remaining_Demand"); dtLeg.Columns.Add("Usage_Ratio"); dtLeg.Columns.Add("Waitlist"); dtLeg.Columns.Add("Limit_Class"); dtLeg.Columns.Add("rec_limit"); dtLeg.Columns.Add("curr_limit"); dtLeg.Columns.Add("App_Capacity"); dtLeg.Columns.Add("Rec_Capacity"); dtLeg.Columns.Add("Is_Summary"); dtLeg.Columns.Add("Current_Resource_Limit1"); dtLeg.Columns.Add("Recommand_Resource_Limit1"); dtLeg.Columns.Add("Upsell_Resource_limit1"); dtLeg.Columns.Add("Adjusted_Resource_limit1"); dtLeg.Columns.Add("Current_Resource_Limit2"); dtLeg.Columns.Add("Recommand_Resource_Limit2"); dtLeg.Columns.Add("Upsell_Resource_limit2"); dtLeg.Columns.Add("Adjusted_Resource_limit2"); dtLeg.Columns.Add("Include_In_Total_Flag"); dtLeg.Columns.Add("Keep_Curr_Auth"); dtLeg.Columns.Add("Discrete_Recomended_Authorization"); dtLeg.Columns.Add("Discrete_Upsell_Authorization"); dtLeg.Columns.Add("Nesting_Type"); dtLeg.Columns.Add("BookingPickup_DaysPrior_i"); dtLeg.Columns.Add("BookingPickup_Per_DaysPrior_i"); dtLeg.Columns.Add("BookingPickup_DaysPrior_j"); dtLeg.Columns.Add("BookingPickup_Per_DaysPrior_j"); dtLeg.Columns.Add("BookingPickup_DaysPrior_k"); dtLeg.Columns.Add("BookingPickup_Per_DaysPrior_k"); dtLeg.Columns.Add("SDL_Booked"); dtLeg.Columns.Add("SDL_Booked_Percentage"); dtLeg.Columns.Add("Travelled_Bookings"); dtLeg.Columns.Add("Travelled_Bookings_Percentage"); dtLeg.Columns.Add("PE_Authorization"); dtLeg.Columns.Add("PE_Availability"); dtLeg.Columns.Add("PE_Booking"); dtLeg.Columns.Add("PE_Boarding"); dtLeg.Columns.Add("PE_Revenue"); dtLeg.Columns.Add("PE_Revenue_Gain"); dtLeg.Columns.Add("Marginal_Fare"); dtLeg.Columns.Add("Marginal_Demand"); dtLeg.Columns.Add("Price_Elasticity"); dtLeg.Columns.Add("PE_Group_ID"); dtLeg.Columns.Add("PE_Demand"); dtLeg.Columns.Add("Max_Alloc_Hus"); dtLeg.Columns.Add("PAX_Buffer_Hus"); dtLeg.Columns.Add("PAX_Buffer_Hus_Type"); dtLeg.Columns.Add("Max_Alloc_Berths"); dtLeg.Columns.Add("PAX_Buffer_Berths"); dtLeg.Columns.Add("PAX_Buffer_Berths_Type"); dtLeg.Columns.Add("IS_Sent"); dtLeg.Columns.Add("StepType"); dtLeg.Columns.Add("Adjusted_Authorizations_Calc"); dtLeg.Columns.Add("SDL_BP_DP_i"); dtLeg.Columns.Add("SDL_BP_DP_j"); dtLeg.Columns.Add("SDL_BP_DP_k"); dtLeg.Columns.Add("current_revenue"); dtLeg.Columns.Add("revenue_SDL"); dtLeg.Columns.Add("Diff_Bkd_LY"); dtLeg.Columns.Add("Diff_Bkd_SDL"); dtLeg.Columns.Add("Diff_Revenue"); dtLeg.Columns.Add("Max_Booked"); DataRow drLeg = dtLeg.NewRow(); drLeg["Case_Number"] = cNo; drLeg["Departure_Detail_Id"] = dDetID; drLeg["Departure_Id"] = dID; drLeg["Cabin_Class"] = cCls; drLeg["Leg_Segment_type"] = "Leg"; drLeg["Departure_Detail_Capture_Id"] = "43824017"; drLeg["DDC_Compartment_Id"] = System.DBNull.Value; drLeg["Compartment_Structure_Id"] = System.DBNull.Value; drLeg["Compartment_Name"] = System.DBNull.Value; dtLeg.Rows.Add(drLeg); dtComp.Columns.Add("Case_Number"); dtComp.Columns.Add("Departure_Detail_Id"); dtComp.Columns.Add("Departure_Id"); dtComp.Columns.Add("Cabin_Class"); dtComp.Columns.Add("Leg_Segment_type"); dtComp.Columns.Add("Departure_Detail_Capture_Id"); dtComp.Columns.Add("DDC_Compartment_Id"); dtComp.Columns.Add("Compartment_Structure_Id"); dtComp.Columns.Add("Compartment_Name"); dtComp.Columns.Add("Compartment_id"); dtComp.Columns.Add("DDC_Class_Id"); dtComp.Columns.Add("Class_Structure_Id"); dtComp.Columns.Add("Class_Name"); dtComp.Columns.Add("Class_id"); dtComp.Columns.Add("DDC_Subclass_Id"); dtComp.Columns.Add("Subclass_Structure_Id"); dtComp.Columns.Add("Subclass_Name"); dtComp.Columns.Add("Subclass_id"); dtComp.Columns.Add("Adjusted_Authorizations"); dtComp.Columns.Add("Adjusted_Availability"); dtComp.Columns.Add("Adjusted_Bid_Price"); dtComp.Columns.Add("Adjusted_Boardings"); dtComp.Columns.Add("Adjusted_Bookings"); dtComp.Columns.Add("Adjusted_Load_Factor"); dtComp.Columns.Add("Adjusted_Physical_Load_Factor"); dtComp.Columns.Add("Adjusted_Revenue"); dtComp.Columns.Add("Adjusted_Revenue_Gain"); dtComp.Columns.Add("Adjusted_SCI"); dtComp.Columns.Add("Authorized_Capacity"); dtComp.Columns.Add("Average_Fare_Value"); dtComp.Columns.Add("Booked_Costs"); dtComp.Columns.Add("Booked_Revenue"); dtComp.Columns.Add("Class_Usage_Ratio"); dtComp.Columns.Add("Confidence"); dtComp.Columns.Add("Current_Authorizations"); dtComp.Columns.Add("Current_Availability"); dtComp.Columns.Add("Current_Bookings"); dtComp.Columns.Add("Current_SCI"); dtComp.Columns.Add("Go_Shows"); dtComp.Columns.Add("Group_Bookings"); dtComp.Columns.Add("Group_No_Show_Percentage"); dtComp.Columns.Add("Limit_Compartment"); dtComp.Columns.Add("Max_Constraint_Type"); dtComp.Columns.Add("Maximum_Authorizations_Constraint"); dtComp.Columns.Add("Maximum_Leg_Authorization"); dtComp.Columns.Add("Min_Constraint_Type"); dtComp.Columns.Add("Minimum_Authorizations_Constraint"); dtComp.Columns.Add("No_Show_Percentage"); dtComp.Columns.Add("No_Shows"); dtComp.Columns.Add("Overbooking_Amount"); dtComp.Columns.Add("Overbooking_Cost"); dtComp.Columns.Add("Physical_Capacity"); dtComp.Columns.Add("Projected_Authorized_Load_Factor"); dtComp.Columns.Add("Projected_Boardings"); dtComp.Columns.Add("Projected_Bookings"); dtComp.Columns.Add("Projected_Physical_Load_Factor"); dtComp.Columns.Add("Projected_Revenue"); dtComp.Columns.Add("Recommended_Authorized_Load_Factor"); dtComp.Columns.Add("Recommended_Authorizations"); dtComp.Columns.Add("Recommended_Availability"); dtComp.Columns.Add("Recommended_Bid_Price"); dtComp.Columns.Add("Recommended_Boardings"); dtComp.Columns.Add("Recommended_Bookings"); dtComp.Columns.Add("Recommended_Physical_Load_Factor"); dtComp.Columns.Add("Recommended_Revenue"); dtComp.Columns.Add("Recommended_Revenue_Gain"); dtComp.Columns.Add("Recommended_SCI"); dtComp.Columns.Add("Remaining_Cancellations"); dtComp.Columns.Add("Original_Demand"); dtComp.Columns.Add("Remaining_Demand"); dtComp.Columns.Add("Revenue_Target"); dtComp.Columns.Add("Standard_Deviation"); dtComp.Columns.Add("Theoretical_Capacity"); dtComp.Columns.Add("Total_Booked_Costs"); dtComp.Columns.Add("Total_Booked_Revenue"); dtComp.Columns.Add("Total_Group_Bookings"); dtComp.Columns.Add("Total_Projected_Demand"); dtComp.Columns.Add("Total_Waitlist"); dtComp.Columns.Add("Unit_Target"); dtComp.Columns.Add("Upsell_Adjusted_Demand"); dtComp.Columns.Add("Upsell_Authorizations"); dtComp.Columns.Add("Upsell_Availability"); dtComp.Columns.Add("Upsell_Boardings"); dtComp.Columns.Add("Upsell_Bookings"); dtComp.Columns.Add("Upsell_Probability"); dtComp.Columns.Add("Upsell_Revenue"); dtComp.Columns.Add("Upsell_Revenue_Gain"); dtComp.Columns.Add("Upsell_SCI"); dtComp.Columns.Add("Upsell_Remaining_Demand"); dtComp.Columns.Add("Usage_Ratio"); dtComp.Columns.Add("Waitlist"); dtComp.Columns.Add("Limit_Class"); dtComp.Columns.Add("rec_limit"); dtComp.Columns.Add("curr_limit"); dtComp.Columns.Add("App_Capacity"); dtComp.Columns.Add("Rec_Capacity"); dtComp.Columns.Add("Is_Summary"); dtComp.Columns.Add("Current_Resource_Limit1"); dtComp.Columns.Add("Recommand_Resource_Limit1"); dtComp.Columns.Add("Upsell_Resource_limit1"); dtComp.Columns.Add("Adjusted_Resource_limit1"); dtComp.Columns.Add("Current_Resource_Limit2"); dtComp.Columns.Add("Recommand_Resource_Limit2"); dtComp.Columns.Add("Upsell_Resource_limit2"); dtComp.Columns.Add("Adjusted_Resource_limit2"); dtComp.Columns.Add("Include_In_Total_Flag"); dtComp.Columns.Add("Keep_Curr_Auth"); dtComp.Columns.Add("Discrete_Recomended_Authorization"); dtComp.Columns.Add("Discrete_Upsell_Authorization"); dtComp.Columns.Add("Nesting_Type"); dtComp.Columns.Add("BookingPickup_DaysPrior_i"); dtComp.Columns.Add("BookingPickup_Per_DaysPrior_i"); dtComp.Columns.Add("BookingPickup_DaysPrior_j"); dtComp.Columns.Add("BookingPickup_Per_DaysPrior_j"); dtComp.Columns.Add("BookingPickup_DaysPrior_k"); dtComp.Columns.Add("BookingPickup_Per_DaysPrior_k"); dtComp.Columns.Add("SDL_Booked"); dtComp.Columns.Add("SDL_Booked_Percentage"); dtComp.Columns.Add("Travelled_Bookings"); dtComp.Columns.Add("Travelled_Bookings_Percentage"); dtComp.Columns.Add("PE_Authorization"); dtComp.Columns.Add("PE_Availability"); dtComp.Columns.Add("PE_Booking"); dtComp.Columns.Add("PE_Boarding"); dtComp.Columns.Add("PE_Revenue"); dtComp.Columns.Add("PE_Revenue_Gain"); dtComp.Columns.Add("Marginal_Fare"); dtComp.Columns.Add("Marginal_Demand"); dtComp.Columns.Add("Price_Elasticity"); dtComp.Columns.Add("PE_Group_ID"); dtComp.Columns.Add("PE_Demand"); dtComp.Columns.Add("Max_Alloc_Hus"); dtComp.Columns.Add("PAX_Buffer_Hus"); dtComp.Columns.Add("PAX_Buffer_Hus_Type"); dtComp.Columns.Add("Max_Alloc_Berths"); dtComp.Columns.Add("PAX_Buffer_Berths"); dtComp.Columns.Add("PAX_Buffer_Berths_Type"); dtComp.Columns.Add("IS_Sent"); dtComp.Columns.Add("StepType"); dtComp.Columns.Add("Adjusted_Authorizations_Calc"); dtComp.Columns.Add("SDL_BP_DP_i"); dtComp.Columns.Add("SDL_BP_DP_j"); dtComp.Columns.Add("SDL_BP_DP_k"); dtComp.Columns.Add("current_revenue"); dtComp.Columns.Add("revenue_SDL"); dtComp.Columns.Add("Diff_Bkd_LY"); dtComp.Columns.Add("Diff_Bkd_SDL"); dtComp.Columns.Add("Diff_Revenue"); dtComp.Columns.Add("Max_Booked"); dtComp.Columns.Add("COMPARTMENT_STRUCTURE_COMPARTMENT_ORDER"); DataRow drComp = dtComp.NewRow(); drComp["Case_Number"] = cNo; drComp["Departure_Detail_Id"] = dDetID; drComp["Departure_Id"] = dID; drComp["Cabin_Class"] = cCls; drComp["Leg_Segment_type"] = "Leg"; drComp["Departure_Detail_Capture_Id"] = "43824017"; drComp["DDC_Compartment_Id"] = "60513359"; drComp["Compartment_Structure_Id"] = 4; drComp["Compartment_Name"] = "J"; drComp["Compartment_id"] = 1; drComp["Adjusted_Authorizations"] = 8; drComp["Adjusted_Availability"] = 7; drComp["Adjusted_Boardings"] = 1; drComp["Adjusted_Bookings"] = 1; drComp["Adjusted_Load_Factor"] = 0; drComp["Adjusted_Revenue"] = 349; drComp["Current_Authorizations"] = 8; drComp["Current_Availability"] = 7; dtComp.Rows.Add(drComp); DataRow drComp1 = dtComp.NewRow(); drComp1["Case_Number"] = cNo; drComp1["Departure_Detail_Id"] = dDetID; drComp1["Departure_Id"] = dID; drComp1["Cabin_Class"] = cCls; drComp1["Leg_Segment_type"] = "Leg"; drComp1["Departure_Detail_Capture_Id"] = "43824017"; drComp1["DDC_Compartment_Id"] = "60513360"; drComp1["Compartment_Structure_Id"] = 5; drComp1["Compartment_Name"] = "Y"; drComp1["Compartment_id"] = 2; drComp1["Adjusted_Authorizations"] = 114; drComp1["Adjusted_Availability"] = 97; drComp1["Adjusted_Boardings"] = 39; drComp1["Adjusted_Bookings"] = 39; drComp1["Adjusted_Load_Factor"] = 0; drComp1["Adjusted_Revenue"] = 350; drComp1["Current_Authorizations"] = 10; drComp1["Current_Availability"] = 10; dtComp.Rows.Add(drComp1); dtClass.Columns.Add("Case_Number"); dtClass.Columns.Add("Departure_Detail_Id"); dtClass.Columns.Add("Departure_Id"); dtClass.Columns.Add("Cabin_Class"); dtClass.Columns.Add("Leg_Segment_type"); dtClass.Columns.Add("Departure_Detail_Capture_Id"); dtClass.Columns.Add("DDC_Compartment_Id"); dtClass.Columns.Add("Compartment_Structure_Id"); dtClass.Columns.Add("Compartment_Name"); dtClass.Columns.Add("Compartment_id"); dtClass.Columns.Add("DDC_Class_Id"); dtClass.Columns.Add("Class_Structure_Id"); dtClass.Columns.Add("Class_Name"); dtClass.Columns.Add("Class_id"); dtClass.Columns.Add("DDC_Subclass_Id"); dtClass.Columns.Add("Subclass_Structure_Id"); dtClass.Columns.Add("Subclass_Name"); dtClass.Columns.Add("Subclass_id"); dtClass.Columns.Add("Adjusted_Authorizations"); dtClass.Columns.Add("Adjusted_Availability"); dtClass.Columns.Add("Adjusted_Bid_Price"); dtClass.Columns.Add("Adjusted_Boardings"); dtClass.Columns.Add("Adjusted_Bookings"); dtClass.Columns.Add("Adjusted_Load_Factor"); dtClass.Columns.Add("Adjusted_Physical_Load_Factor"); dtClass.Columns.Add("Adjusted_Revenue"); dtClass.Columns.Add("Adjusted_Revenue_Gain"); dtClass.Columns.Add("Adjusted_SCI"); dtClass.Columns.Add("Authorized_Capacity"); dtClass.Columns.Add("Average_Fare_Value"); dtClass.Columns.Add("Booked_Costs"); dtClass.Columns.Add("Booked_Revenue"); dtClass.Columns.Add("Class_Usage_Ratio"); dtClass.Columns.Add("Confidence"); dtClass.Columns.Add("Current_Authorizations"); dtClass.Columns.Add("Current_Availability"); dtClass.Columns.Add("Current_Bookings"); dtClass.Columns.Add("Current_SCI"); dtClass.Columns.Add("Go_Shows"); dtClass.Columns.Add("Group_Bookings"); dtClass.Columns.Add("Group_No_Show_Percentage"); dtClass.Columns.Add("Limit_Compartment"); dtClass.Columns.Add("Max_Constraint_Type"); dtClass.Columns.Add("Maximum_Authorizations_Constraint"); dtClass.Columns.Add("Maximum_Leg_Authorization"); dtClass.Columns.Add("Min_Constraint_Type"); dtClass.Columns.Add("Minimum_Authorizations_Constraint"); dtClass.Columns.Add("No_Show_Percentage"); dtClass.Columns.Add("No_Shows"); dtClass.Columns.Add("Overbooking_Amount"); dtClass.Columns.Add("Overbooking_Cost"); dtClass.Columns.Add("Physical_Capacity"); dtClass.Columns.Add("Projected_Authorized_Load_Factor"); dtClass.Columns.Add("Projected_Boardings"); dtClass.Columns.Add("Projected_Bookings"); dtClass.Columns.Add("Projected_Physical_Load_Factor"); dtClass.Columns.Add("Projected_Revenue"); dtClass.Columns.Add("Recommended_Authorized_Load_Factor"); dtClass.Columns.Add("Recommended_Authorizations"); dtClass.Columns.Add("Recommended_Availability"); dtClass.Columns.Add("Recommended_Bid_Price"); dtClass.Columns.Add("Recommended_Boardings"); dtClass.Columns.Add("Recommended_Bookings"); dtClass.Columns.Add("Recommended_Physical_Load_Factor"); dtClass.Columns.Add("Recommended_Revenue"); dtClass.Columns.Add("Recommended_Revenue_Gain"); dtClass.Columns.Add("Recommended_SCI"); dtClass.Columns.Add("Remaining_Cancellations"); dtClass.Columns.Add("Original_Demand"); dtClass.Columns.Add("Remaining_Demand"); dtClass.Columns.Add("Revenue_Target"); dtClass.Columns.Add("Standard_Deviation"); dtClass.Columns.Add("Theoretical_Capacity"); dtClass.Columns.Add("Total_Booked_Costs"); dtClass.Columns.Add("Total_Booked_Revenue"); dtClass.Columns.Add("Total_Group_Bookings"); dtClass.Columns.Add("Total_Projected_Demand"); dtClass.Columns.Add("Total_Waitlist"); dtClass.Columns.Add("Unit_Target"); dtClass.Columns.Add("Upsell_Adjusted_Demand"); dtClass.Columns.Add("Upsell_Authorizations"); dtClass.Columns.Add("Upsell_Availability"); dtClass.Columns.Add("Upsell_Boardings"); dtClass.Columns.Add("Upsell_Bookings"); dtClass.Columns.Add("Upsell_Probability"); dtClass.Columns.Add("Upsell_Revenue"); dtClass.Columns.Add("Upsell_Revenue_Gain"); dtClass.Columns.Add("Upsell_SCI"); dtClass.Columns.Add("Upsell_Remaining_Demand"); dtClass.Columns.Add("Usage_Ratio"); dtClass.Columns.Add("Waitlist"); dtClass.Columns.Add("Limit_Class"); dtClass.Columns.Add("rec_limit"); dtClass.Columns.Add("curr_limit"); dtClass.Columns.Add("App_Capacity"); dtClass.Columns.Add("Rec_Capacity"); dtClass.Columns.Add("Is_Summary"); dtClass.Columns.Add("Current_Resource_Limit1"); dtClass.Columns.Add("Recommand_Resource_Limit1"); dtClass.Columns.Add("Upsell_Resource_limit1"); dtClass.Columns.Add("Adjusted_Resource_limit1"); dtClass.Columns.Add("Current_Resource_Limit2"); dtClass.Columns.Add("Recommand_Resource_Limit2"); dtClass.Columns.Add("Upsell_Resource_limit2"); dtClass.Columns.Add("Adjusted_Resource_limit2"); dtClass.Columns.Add("Include_In_Total_Flag"); dtClass.Columns.Add("Keep_Curr_Auth"); dtClass.Columns.Add("Discrete_Recomended_Authorization"); dtClass.Columns.Add("Discrete_Upsell_Authorization"); dtClass.Columns.Add("Nesting_Type"); dtClass.Columns.Add("BookingPickup_DaysPrior_i"); dtClass.Columns.Add("BookingPickup_Per_DaysPrior_i"); dtClass.Columns.Add("BookingPickup_DaysPrior_j"); dtClass.Columns.Add("BookingPickup_Per_DaysPrior_j"); dtClass.Columns.Add("BookingPickup_DaysPrior_k"); dtClass.Columns.Add("BookingPickup_Per_DaysPrior_k"); dtClass.Columns.Add("SDL_Booked"); dtClass.Columns.Add("SDL_Booked_Percentage"); dtClass.Columns.Add("Travelled_Bookings"); dtClass.Columns.Add("Travelled_Bookings_Percentage"); dtClass.Columns.Add("PE_Authorization"); dtClass.Columns.Add("PE_Availability"); dtClass.Columns.Add("PE_Booking"); dtClass.Columns.Add("PE_Boarding"); dtClass.Columns.Add("PE_Revenue"); dtClass.Columns.Add("PE_Revenue_Gain"); dtClass.Columns.Add("Marginal_Fare"); dtClass.Columns.Add("Marginal_Demand"); dtClass.Columns.Add("Price_Elasticity"); dtClass.Columns.Add("PE_Group_ID"); dtClass.Columns.Add("PE_Demand"); dtClass.Columns.Add("Max_Alloc_Hus"); dtClass.Columns.Add("PAX_Buffer_Hus"); dtClass.Columns.Add("PAX_Buffer_Hus_Type"); dtClass.Columns.Add("Max_Alloc_Berths"); dtClass.Columns.Add("PAX_Buffer_Berths"); dtClass.Columns.Add("PAX_Buffer_Berths_Type"); dtClass.Columns.Add("IS_Sent"); dtClass.Columns.Add("StepType"); dtClass.Columns.Add("Adjusted_Authorizations_Calc"); dtClass.Columns.Add("SDL_BP_DP_i"); dtClass.Columns.Add("SDL_BP_DP_j"); dtClass.Columns.Add("SDL_BP_DP_k"); dtClass.Columns.Add("current_revenue"); dtClass.Columns.Add("revenue_SDL"); dtClass.Columns.Add("Diff_Bkd_LY"); dtClass.Columns.Add("Diff_Bkd_SDL"); dtClass.Columns.Add("Diff_Revenue"); dtClass.Columns.Add("Max_Booked"); dtClass.Columns.Add("COMPARTMENT_STRUCTURE_COMPARTMENT_ORDER"); DataRow drClass = dtClass.NewRow(); drClass["Case_Number"] = cNo; drClass["Departure_Detail_Id"] = dDetID; drClass["Departure_Id"] = dID; drClass["Cabin_Class"] = cCls; drClass["Leg_Segment_type"] = "Leg"; drClass["Departure_Detail_Capture_Id"] = "43824017"; drClass["DDC_Compartment_Id"] = "60513360"; drClass["Compartment_Structure_Id"] = 5; drClass["Compartment_Name"] = "Y"; drClass["Compartment_id"] = 2; drClass["DDC_Class_Id"] = "6022025"; drClass["Class_Structure_Id"] = 4; drClass["Class_Name"] = "Y"; drClass["Class_id"] = 4; drClass["Adjusted_Authorizations"] = 8; drClass["Adjusted_Availability"] = 7; drClass["Adjusted_Boardings"] = 1; drClass["Adjusted_Bookings"] = 1; drClass["Adjusted_Load_Factor"] = 0; drClass["Adjusted_Revenue"] = 349; drClass["Current_Authorizations"] = 8; drClass["Current_Availability"] = 7; dtClass.Rows.Add(drClass); DataRow drClass1 = dtClass.NewRow(); drClass1["Case_Number"] = cNo; drClass1["Departure_Detail_Id"] = dDetID; drClass1["Departure_Id"] = dID; drClass1["Cabin_Class"] = cCls; drClass1["Leg_Segment_type"] = "Leg"; drClass1["Departure_Detail_Capture_Id"] = "43824017"; drClass1["DDC_Compartment_Id"] = "60513359"; drClass1["Compartment_Structure_Id"] = 4; drClass1["Compartment_Name"] = "J"; drClass1["Compartment_id"] = 1; drClass1["DDC_Class_Id"] = "6022020"; drClass1["Class_Structure_Id"] = 1; drClass1["Class_Name"] = "J"; drClass1["Class_id"] = 1; drClass1["Adjusted_Authorizations"] = 8; drClass1["Adjusted_Availability"] = 7; drClass1["Adjusted_Boardings"] = 1; drClass1["Adjusted_Bookings"] = 1; drClass1["Adjusted_Load_Factor"] = 0; drClass1["Adjusted_Revenue"] = 349; drClass1["Current_Authorizations"] = 8; drClass1["Current_Availability"] = 7; dtClass.Rows.Add(drClass1); DataRow drClass2 = dtClass.NewRow(); drClass2["Case_Number"] = cNo; drClass2["Departure_Detail_Id"] = dDetID; drClass2["Departure_Id"] = dID; drClass2["Cabin_Class"] = cCls; drClass2["Leg_Segment_type"] = "Leg"; drClass2["Departure_Detail_Capture_Id"] = "43824017"; drClass2["DDC_Compartment_Id"] = "60513359"; drClass2["Compartment_Structure_Id"] = 4; drClass2["Compartment_Name"] = "J"; drClass2["Compartment_id"] = 1; drClass2["DDC_Class_Id"] = "6022020"; drClass2["Class_Structure_Id"] = 17; drClass2["Class_Name"] = "C"; drClass2["Class_id"] = 17; drClass2["Adjusted_Authorizations"] = 8; drClass2["Adjusted_Availability"] = 7; drClass2["Adjusted_Boardings"] = 1; drClass2["Adjusted_Bookings"] = 1; drClass2["Adjusted_Load_Factor"] = 0; drClass2["Adjusted_Revenue"] = 349; drClass2["Current_Authorizations"] = 8; drClass2["Current_Availability"] = 7; dtClass.Rows.Add(drClass2); BindGrid(); } catch(Exception) { throw; } } private void BindGrid() { try { radGridWorksheet.MasterTemplate.Templates.Clear(); radGridWorksheet.Relations.Clear(); radGridWorksheet.DataSource = dtLeg; radGridWorksheet.AllowAddNewRow = false; radGridWorksheet.AllowDeleteRow = false; radGridWorksheet.AllowEditRow = true; radGridWorksheet.AutoGenerateColumns = true; radGridWorksheet.BestFitColumns(); radGridWorksheet.GridViewElement.DrawBorder = false; radGridWorksheet.GridViewElement.GroupPanelElement.DrawBorder = false; GridViewTemplate childDetailCaptureDate = new GridViewTemplate(); childDetailCaptureDate.Caption = "Leg"; childDetailCaptureDate.Columns.Clear(); childDetailCaptureDate.AllowAddNewRow = false; childDetailCaptureDate.AllowDeleteRow = false; childDetailCaptureDate.AllowEditRow = true; childDetailCaptureDate.AutoGenerateColumns = true; childDetailCaptureDate.BestFitColumns(); childDetailCaptureDate.DataSource = dtComp; radGridWorksheet.MasterTemplate.Templates.Add(childDetailCaptureDate); GridViewRelation relationCaptureDate = new GridViewRelation(radGridWorksheet.MasterTemplate); relationCaptureDate.ChildTemplate = childDetailCaptureDate; relationCaptureDate.RelationName = "Capture"; relationCaptureDate.ParentColumnNames.Add("Departure_Detail_Capture_Id"); relationCaptureDate.ChildColumnNames.Add("Departure_Detail_Capture_Id"); radGridWorksheet.Relations.Add(relationCaptureDate); GridViewTemplate childDetailCaptureDateComp = new GridViewTemplate(); childDetailCaptureDateComp.Caption = "Comp"; childDetailCaptureDateComp.Columns.Clear(); childDetailCaptureDateComp.AllowAddNewRow = false; childDetailCaptureDateComp.AllowDeleteRow = false; childDetailCaptureDateComp.AllowEditRow = true; childDetailCaptureDateComp.AutoGenerateColumns = true; childDetailCaptureDateComp.BestFitColumns(); childDetailCaptureDateComp.DataSource = dtClass; childDetailCaptureDate.Templates.Add(childDetailCaptureDateComp); GridViewRelation relationCaptureDateCompatment = new GridViewRelation(childDetailCaptureDate); relationCaptureDateCompatment.ChildTemplate = childDetailCaptureDateComp; relationCaptureDateCompatment.RelationName = "Compartment"; relationCaptureDateCompatment.ParentColumnNames.Add("DDC_Compartment_Id"); relationCaptureDateCompatment.ChildColumnNames.Add("DDC_Compartment_Id"); radGridWorksheet.Relations.Add(relationCaptureDateCompatment); radGridWorksheet.MasterTemplate.ExpandAll(); } catch(Exception e0) { MessageBox.Show(String.Format("{0}\n{1}", e0.Message, e0.StackTrace)); throw; } } private void radButton1_Click(object sender, EventArgs e) { try { intClickCount = intClickCount + 1; //Thread.Sleep(1000); radButton1.Text = "Next Click " + intClickCount; BindTables(); } catch(Exception e0) { MessageBox.Show(String.Format("{0}\n{1}", e0.Message, e0.StackTrace)); throw; } } }
To reproduce: - Create a self reference grid and set the columns width so the horizontal scrollbar is visible. - Scroll to the right and filter by the last column, - Type a single character, the the edited cell is now changed. Workaround: class MyFilterCell : GridFilterCellElement { protected override Type ThemeEffectiveType { get { return typeof(GridFilterCellElement); } } public MyFilterCell(GridViewDataColumn column, GridRowElement row) : base(column, row) { } public override bool IsCompatible(GridViewColumn data, object context) { return false; } }
Workaround: handle the SortChanging and FilterChanging events and clear the search criteria from the search row. The stored search string can later be restored in the SortChanged and FilterChanged events string filter = string.Empty; private void RadGrid_FilterChanged(object sender, GridViewCollectionChangedEventArgs e) { this.radGrid.MasterView.TableSearchRow.Search(filter); } private void RadGrid_SortChanged(object sender, GridViewCollectionChangedEventArgs e) { this.radGrid.MasterView.TableSearchRow.Search(filter); } private void RadGrid_SortChanging(object sender, GridViewCollectionChangingEventArgs e) { this.filter = this.radGrid.MasterView.TableSearchRow.SearchCriteria; this.radGrid.MasterView.TableSearchRow.Search(null); } private void RadGrid_FilterChanging(object sender, GridViewCollectionChangingEventArgs e) { this.filter = this.radGrid.MasterView.TableSearchRow.SearchCriteria; this.radGrid.MasterView.TableSearchRow.Search(null); }