To reproduce: change the value for a GridCheckBoxCellElement. The editor is not active. However, if you click again over the current cell, the editor will be activated. Workaround: use a custom row behavior to close the editor: //register the custom row behavior BaseGridBehavior gridBehavior = sourceRadGridView.GridBehavior as BaseGridBehavior; gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo)); gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo), new CustomGridDataRowBehavior()); public class CustomGridDataRowBehavior : GridDataRowBehavior { public override bool OnMouseUp(MouseEventArgs e) { bool result = base.OnMouseUp(e); if (this.MasterTemplate.CurrentColumn is GridViewCheckBoxColumn ) { this.GridViewElement.EndEdit(); } return result; } }
To reproduce: DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Rows.Add(1, new string('G', 32001)); this.radGridView1.DataSource = dt; this.radGridView1.PrintPreview(); Workaround: this.radGridView1.PrintCellFormatting+=radGridView1_PrintCellFormatting; private void radGridView1_PrintCellFormatting(object sender, PrintCellFormattingEventArgs e) { e.PrintCell.Text = e.PrintCell.Text.Substring(0,Math.Min(e.PrintCell.Text.Length, 32000)); }
To reproduce: public Form1() { InitializeComponent(); this.radGridView1.CellFormatting+=radGridView1_CellFormatting; DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name",typeof(string)); for (int i = 0; i < 100; i++) { dt.Rows.Add(i,"Item"+i); } this.radGridView1.DataSource = dt; this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; } private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e) { e.Row.Height = 40; } private void radButton1_Click(object sender, EventArgs e) { this.radGridView1.TableElement.ScrollToRow(this.radGridView1.Rows.Count - 1); } Workaround: instead of using the CellFormatting event to set the Row.Height, you can set the TableElement.RowHeight property.
To reproduce: use the following code snippet and refer to the attached sample gif file. When you enter edit mode for the first time, the editor is empty. Each next entering edit mode displays the respective text in the editor, although it is cut off. public Form1() { InitializeComponent(); radGridView1.Font = new Font("Segoe UI", 18.0f); radGridView1.CellEditorInitialized += pgGrid_CellEditorInitialized; AddColumns(); radGridView1.DataSource = BuildDummyTable(); radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; } private void pgGrid_CellEditorInitialized(object sender, GridViewCellEventArgs e) { RadTextBoxEditor editor = e.ActiveEditor as RadTextBoxEditor; if (editor != null) { ((RadTextBoxEditorElement)editor.EditorElement).TextBoxItem.Multiline = true; ((RadTextBoxEditorElement)editor.EditorElement).Padding = new Padding(0); } } private void AddColumns() { GridViewTextBoxColumn colA = new GridViewTextBoxColumn("colA"); radGridView1.Columns.Add(colA); GridViewTextBoxColumn colB = new GridViewTextBoxColumn("colB"); radGridView1.Columns.Add(colB); GridViewTextBoxColumn colC = new GridViewTextBoxColumn("colC"); radGridView1.Columns.Add(colC); GridViewTextBoxColumn colD = new GridViewTextBoxColumn("colD"); radGridView1.Columns.Add(colD); } private DataTable BuildDummyTable() { DataTable table = new DataTable(); table.Columns.Add("colA"); table.Columns.Add("colB"); table.Columns.Add("colC"); table.Columns.Add("colD"); table.Rows.Add("value 1A", "value 1B", "value 1C", "value 1D"); table.Rows.Add("value 2A", "value 2B", "value 2C", "value 2D"); table.Rows.Add("value 3A", "value 3B", "value 3C", "value 3D"); return table; }
Workaround: public Form1() { InitializeComponent(); this.radGridView1.CreateCell += radGridView1_CreateCell; GridViewCheckBoxColumn checkBoxColumn = new GridViewCheckBoxColumn("CheckBoxColumn"); checkBoxColumn.EnableHeaderCheckBox = false; checkBoxColumn.ThreeState = true; checkBoxColumn.EditMode = EditMode.OnValueChange; radGridView1.MasterTemplate.Columns.Add(checkBoxColumn); radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; for (int i = 0; i < 20; i++) { this.radGridView1.Rows.Add(false); } } private void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e) { if (e.CellType == typeof(GridCheckBoxHeaderCellElement)) { CustomGridCheckBoxHeaderCellElement headerCell = new CustomGridCheckBoxHeaderCellElement(e.Column, e.Row); e.CellElement = headerCell; } } public class CustomGridCheckBoxHeaderCellElement : GridHeaderCellElement { public CustomGridCheckBoxHeaderCellElement(GridViewColumn column, GridRowElement row) : base(column, row) { } protected override Type ThemeEffectiveType { get { return typeof(GridHeaderCellElement); } } RadCheckBoxElement cb = new RadCheckBoxElement(); protected override void CreateChildElements() { base.CreateChildElements(); this.Children.Add(cb); cb.IsThreeState = true; cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off; cb.ToggleStateChanged += CheckBox_ToggleStateChanged; } bool boolValue = false; public override void SetContent() { base.SetContent(); if (!flag) { bool atLeastOneTrue = false; bool atLeastOneFalse = false; foreach (GridViewRowInfo r in this.GridViewElement.Template.Rows) { if (r.Cells[0].Value != null) { if (atLeastOneTrue && atLeastOneFalse) { break; } boolValue = (bool)r.Cells[0].Value; if (boolValue) { atLeastOneTrue = true; } else { atLeastOneFalse = true; } } else { atLeastOneFalse = true; } } if (atLeastOneFalse && atLeastOneTrue) { cb.ToggleStateChanged -= CheckBox_ToggleStateChanged; cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Indeterminate; cb.ToggleStateChanged += CheckBox_ToggleStateChanged; } else if (atLeastOneFalse == true) { cb.ToggleStateChanged -= CheckBox_ToggleStateChanged; cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off; cb.ToggleStateChanged += CheckBox_ToggleStateChanged; } else if (atLeastOneTrue == true) { cb.ToggleStateChanged -= CheckBox_ToggleStateChanged; cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On; cb.ToggleStateChanged += CheckBox_ToggleStateChanged; } } } bool flag = false; private void CheckBox_ToggleStateChanged(object sender, StateChangedEventArgs args) { cb.ToggleStateChanged -= CheckBox_ToggleStateChanged; flag = true; if (args.ToggleState == Telerik.WinControls.Enumerations.ToggleState.Indeterminate) { cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off; } ToggleStateForChildRows(args.ToggleState, this.GridControl); flag = false; cb.ToggleStateChanged += CheckBox_ToggleStateChanged; } private void ToggleStateForChildRows(Telerik.WinControls.Enumerations.ToggleState toggleState, RadGridView radGridView) { foreach (GridViewRowInfo r in radGridView.Rows) { r.Cells[0].Value = toggleState == Telerik.WinControls.Enumerations.ToggleState.On; } } }
Note: it is reproducible when using ColumnGroupsViewDefinition too. Workaround: unpin all pinned columns before printing and restore their state after printing:
To reproduce: public RadForm1() { InitializeComponent(); Controls.Add(new RadGridView { Dock = DockStyle.Fill, ShowHeaderCellButtons = true, ReadOnly = true, AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill, EnableFiltering = true, DataSource = Enumerable.Range(0, 24000) //Increase this number when you can't reproduce this issue .Select(x => new { Name = string.Format("Item {0}", x) }), }); } Workaround: class MyListFillter : RadListFilterPopup { public MyListFillter(GridViewDataColumn column, bool groupDateValues) : base(column, groupDateValues) { } protected override void OnButtonOkClick(EventArgs e) { FilterOperator filterOperator = FilterOperator.IsEqualTo; var listFilterElement = typeof(RadListFilterPopup).GetField("listFilterElement", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as FilterMenuTreeElement; switch (listFilterElement.SelectedMode) { case ListFilterSelectedMode.All: filterOperator = FilterOperator.None; break; case ListFilterSelectedMode.Null: filterOperator = FilterOperator.IsNull; break; case ListFilterSelectedMode.NotNull: filterOperator = FilterOperator.IsNotNull; break; } if (filterOperator != FilterOperator.IsEqualTo) { SetFilterOperator(filterOperator); this.ClosePopup(RadPopupCloseReason.CloseCalled); } else { CompositeFilterDescriptor compositeFilterDescriptor = new CompositeFilterDescriptor(); compositeFilterDescriptor.PropertyName = base.DataColumn.Name; compositeFilterDescriptor.LogicalOperator = FilterLogicalOperator.Or; if (listFilterElement.SelectedValues.Count > this.GetDistinctValuesTable().Count / 2) { foreach (DictionaryEntry entry in this.GetDistinctValuesTable()) { if (!listFilterElement.SelectedValues.Contains(entry.Key)) { foreach (object value in (ArrayList)entry.Value) { FilterDescriptor descriptor; if (base.DataColumn is GridViewDateTimeColumn || base.DataColumn.DataType == typeof(DateTime) || base.DataColumn.DataType == typeof(DateTime?)) { descriptor = new DateFilterDescriptor(base.DataColumn.Name, FilterOperator.IsNotEqualTo, (DateTime?)value, false); } else { descriptor = new FilterDescriptor(base.DataColumn.Name, FilterOperator.IsNotEqualTo, value); } compositeFilterDescriptor.FilterDescriptors.Add(descriptor); } } } } else { foreach (DictionaryEntry entry in listFilterElement.SelectedValues) { foreach (object value in (ArrayList)entry.Value) { FilterDescriptor descriptor; if (base.DataColumn is GridViewDateTimeColumn || base.DataColumn.DataType == typeof(DateTime) || base.DataColumn.DataType == typeof(DateTime?)) { descriptor = new DateFilterDescriptor(base.DataColumn.Name, FilterOperator.IsEqualTo, (DateTime?)value, false); } else { descriptor = new FilterDescriptor(base.DataColumn.Name, FilterOperator.IsEqualTo, value); } compositeFilterDescriptor.FilterDescriptors.Add(descriptor); } } } base.FilterDescriptor = compositeFilterDescriptor; OnFilterConfirmed(); } } }
To reproduce: - Bind the grid to a data source and set its RightToLeftProperty to true. Note: use Visual Studio 2008 under Windows XP with .NET 2.0 Workaround: Private Sub RadGridView1_ViewCellFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) If RadGridView1.RightToLeft = Windows.Forms.RightToLeft.Yes Then e.CellElement.TextAlignment = ContentAlignment.MiddleLeft End If End Sub
To reproduce: - Add grid with a DateTime column with default value "5/1/2014"; - Start the app and press the following keys one after another: 5/1/ - You will notice that the "1" is not replaced. Please note that the similar behavior occur when the year is entered (it does not match the default one). Workaround handle the key press for such cases manually: void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { RadDateTimeEditor ed = e.ActiveEditor as RadDateTimeEditor; RadDateTimeEditorElement el = ed.EditorElement as RadDateTimeEditorElement; el.KeyPress += el_KeyPress; } private void el_KeyPress(object sender, KeyPressEventArgs e) { RadDateTimeEditorElement el = (RadDateTimeEditorElement)sender; int day = el.Value.Value.Day; int key = -1; int.TryParse(e.KeyChar.ToString(), key); RadMaskedEditBoxElement element = el.TextBoxElement.TextBoxItem.Parent as RadMaskedEditBoxElement; MaskDateTimeProvider provider = element.Provider as MaskDateTimeProvider; if (provider.SelectedItemIndex == 2) { if (key > 0 & key <= 9) { if (el.TextBoxElement.TextBoxItem.SelectionLength != 0) { if (!booKeying) { dynamic NewValue = new DateTime(el.Value.Value.Year, el.Value.Value.Month, key); el.Value = NewValue; e.Handled = true; booKeying = true; } } } } }
Workaround: check for the theme and set a minimum size to the text box item private void radGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e) { BaseGridEditor gridEditor = e.ActiveEditor as BaseGridEditor; if (gridEditor != null) { RadTextBoxElement el = gridEditor.OwnerElement.FindDescendant<RadTextBoxElement>(); if (el != null) { if (ThemeResolutionService.ApplicationThemeName == "VisualStudio2012Dark") { el.TextBoxItem.MinSize = new Size(0, 20); el.TextBoxItem.TextBoxControl.MinimumSize = new Size(0, 20); } } } }
To reproduce: protected override void OnLoad(EventArgs e) { this.radGridView1.AllowAddNewRow = false; this.radGridView1.TableElement.RowHeight = 40; this.radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; GridViewTextBoxColumn id = new GridViewTextBoxColumn("ID"); id.IsVisible = false; GridViewTextBoxColumn parentID = new GridViewTextBoxColumn("ParentID"); parentID.IsVisible = false; GridViewTextBoxColumn name = new GridViewTextBoxColumn("Name"); GridViewDateTimeColumn date = new GridViewDateTimeColumn("Date"); GridViewTextBoxColumn type = new GridViewTextBoxColumn("Type"); GridViewTextBoxColumn size = new GridViewTextBoxColumn("Size"); size.FormatString = "{0} MB"; radGridView1.Columns.AddRange(new GridViewDataColumn[] { id, parentID, name, date, type, size }); this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "ID", "ParentID"); radGridView1.CellValueChanged += radGridView1_CellValueChanged; fillData(); } void radGridView1_CellValueChanged(object sender, GridViewCellEventArgs e) { fillData(); } private void fillData() { radGridView1.Rows.Clear(); radGridView1.Rows.Add(1, null, "Program Files", DateTime.Now.AddDays(-100), "Folder", 5120); radGridView1.Rows.Add(2, 1, "Visual Studio 2010", DateTime.Now.AddDays(-100), "Folder", 3220); radGridView1.Rows.Add(3, 2, "bin", DateTime.Now.AddDays(-100), "Folder", 3220); radGridView1.Rows.Add(4, 2, "READEME.txt", DateTime.Now.AddDays(-100), "Text Document", 3); radGridView1.Rows.Add(100, null, "Test.txt", DateTime.Now.AddDays(-10), "Text File", 0); radGridView1.Rows.Add(5, 1, "Telerik RadControls", DateTime.Now.AddDays(-10), "Folder", 3120); radGridView1.Rows.Add(6, 5, "Telerik UI for Winforms", DateTime.Now.AddDays(-10), "Folder", 101); radGridView1.Rows.Add(7, 5, "Telerik UI for Silverlight", DateTime.Now.AddDays(-10), "Folder", 123); radGridView1.Rows.Add(8, 5, "Telerik UI for WPF", DateTime.Now.AddDays(-10), "Folder", 221); radGridView1.Rows.Add(9, 5, "Telerik UI for ASP.NET AJAX", DateTime.Now.AddDays(-10), "Folder", 121); radGridView1.Rows.Add(10, 1, "Microsoft Office 2010", DateTime.Now.AddDays(-120), "Folder", 1230); radGridView1.Rows.Add(11, 10, "Microsoft Word 2010", DateTime.Now.AddDays(-120), "Folder", 1230); radGridView1.Rows.Add(12, 10, "Microsoft Excel 2010", DateTime.Now.AddDays(-120), "Folder", 1230); radGridView1.Rows.Add(13, 10, "Microsoft Powerpoint 2010", DateTime.Now.AddDays(-120), "Folder", 1230); radGridView1.Rows.Add(14, 1, "Debug Diagnostic Tools v1.0", DateTime.Now.AddDays(-400), "Folder", 2120); radGridView1.Rows.Add(15, 1, "Designer's 3D Tools", DateTime.Now.AddDays(-500), "Folder", 1120); radGridView1.Rows.Add(16, 1, "Communication", DateTime.Now.AddDays(-700), "Folder", 120); } Then start the application edit a value and click another cell. Workaround: - Enclose the rows addition within Begin/End update block.
To reproduce: 1 - Add a grid view in a form. 2 - Add 14 - 17 records in grid view. 3 - Allow alternating color for grid view. 4 - Do sorting by clicking on header column (click 3 times). 5 - Alternating color display wrong position. Workaround: void radGridView1_SortChanged(object sender, GridViewCollectionChangedEventArgs e) { foreach (GridRowElement row in this.radGridView1.TableElement.ViewElement.ScrollableRows.Children) { row.Synchronize(); } }
Use the following code snippet: public Form1() { InitializeComponent(); DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Item", typeof(string)); dt.Columns.Add("Price", typeof(decimal)); for (int i = 0; i < 10; i++) { dt.Rows.Add(i % 5, "Item" + i, i * 2.25m); } this.radGridView1.DataSource = dt; GridViewDecimalColumn customCalculatedCol = new GridViewDecimalColumn("Custom Calculated Column"); customCalculatedCol.Name = "Custom Calculated Column"; customCalculatedCol.Expression = "SumIf(Id)"; radGridView1.Columns.Add(customCalculatedCol); GridViewDecimalColumn customCalculatedCola = new GridViewDecimalColumn("Custom Col_A"); radGridView1.Columns.Add(customCalculatedCola); this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; Telerik.Data.Expressions.ExpressionContext.Context = new CustomExpressionContext(radGridView1); } public class CustomExpressionContext : Telerik.Data.Expressions.ExpressionContext { private RadGridView grid; public CustomExpressionContext(RadGridView grid) { this.grid = grid; } public double SumIf(int currentId) { double countIf = 0; decimal sumIf = 0; foreach (GridViewRowInfo r in this.grid.Rows) { if ((int)r.Cells["Id"].Value == currentId) { countIf++; sumIf += (decimal)r.Cells["Price"].Value; } } return (double)sumIf; } } Workaround: invalidate the affected rows manually private void radGridView1_CellValueChanged(object sender, GridViewCellEventArgs e) { if (e.Column.Name == "Price" || e.Column.Name == "Id") { foreach (GridViewRowInfo r in this.radGridView1.Rows) { if ((int)r.Cells["Id"].Value == (int)e.Row.Cells["Id"].Value) { r.InvalidateRow(); } } } }
To reproduce: - Use this code: private void Form1_Load(object sender, EventArgs e) { CenterToParent(); radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized; GridViewTextBoxColumn columnName = new GridViewTextBoxColumn(); columnName.Name = "Name"; columnName.HeaderText = "Name"; columnName.FieldName = "Name"; columnName.MaxLength = 50; columnName.Width = 200; columnName.TextAlignment = ContentAlignment.MiddleLeft; radGridView1.MasterTemplate.Columns.Add(columnName); GridViewDateTimeColumn columnDate = new GridViewDateTimeColumn(); columnDate.Name = "Date"; columnDate.HeaderText = "Date"; columnDate.FieldName = "Date"; columnDate.Format = DateTimePickerFormat.Custom; columnDate.CustomFormat = "MM/dd/yyyy"; columnDate.FormatString = "{0:MM/dd/yyyy}"; columnDate.NullValue = null; columnDate.Width = 100; this.radGridView1.Columns.Add(columnDate); radGridView1.Rows.Add("Row 1", null); radGridView1.Rows.Add("Row 2", null); radGridView1.Rows.Add("Row 3", null); radGridView1.Rows.Add("Row 4", null); } void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { if (e.ActiveEditor is RadDateTimeEditor) { ((RadDateTimePickerElement)((RadDateTimeEditor)e.ActiveEditor).EditorElement).TextBoxElement.MaskType = MaskType.FreeFormDateTime; } } - Start the application and star edition date time value. You will notice that the editor value is initialized incorrectly. This occurs only when the cell is edited for the firs time. Workaround: void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { if (e.ActiveEditor is RadDateTimeEditor) { ((RadDateTimePickerElement)((RadDateTimeEditor)e.ActiveEditor).EditorElement).TextBoxElement.MaskType = MaskType.FreeFormDateTime; e.ActiveEditor.Value = radGridView1.CurrentCell.Value; } }
To reproduce: 1. Add a RadGridView and bind it to Northwind.Products table. 2. Use the following code: Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.ProductsTableAdapter.Fill(Me.NwindDataSet.Products) For Each col As GridViewColumn In Me.RadGridView1.Columns If Not col.HeaderText = "SupplierID" AndAlso Not col.HeaderText = "ProductID" Then col.ReadOnly = True End If Next Me.RadGridView1.AddNewRowPosition = SystemRowPosition.Bottom End Sub Private Sub RadGridView1_CellValidating(sender As Object, e As CellValidatingEventArgs) Handles RadGridView1.CellValidating If e.Value Is Nothing Then If MessageBox.Show("Incorrect", "error", MessageBoxButtons.OKCancel) = Windows.Forms.DialogResult.OK Then e.Cancel = True End If End If End Sub 3. Run the project and go to the new row ,cell "SupplierID". 4. Clear the value and press Tab key. As a result the message box for error indication is shown twice. Workaround: 'register the custom row behavior Dim gridBehavior As BaseGridBehavior = TryCast(RadGridView1.GridBehavior, BaseGridBehavior) gridBehavior.UnregisterBehavior(GetType(GridViewNewRowInfo)) gridBehavior.RegisterBehavior(GetType(GridViewNewRowInfo), New MyNewRowBehavior()) Me.RadGridView1.GridViewElement.Navigator = New MyGridNavigator() Public Class MyNewRowBehavior Inherits GridNewRowBehavior Protected Overrides Function ProcessTabKey(keys As KeyEventArgs) As Boolean If Me.GridControl.AddNewRowPosition = SystemRowPosition.Bottom AndAlso _ Me.GridControl.IsInEditMode AndAlso Me.GridViewElement.Navigator.IsLastColumn(GridViewElement.CurrentColumn) Then Me.GridControl.Tag = "SuspendValidation" End If Return MyBase.ProcessTabKey(keys) End Function End Class Public Class MyGridNavigator Inherits BaseGridNavigator Public Overrides Function SelectFirstColumn() As Boolean If Me.GridViewElement.GridControl.Tag = "SuspendValidation" Then Me.GridViewElement.GridControl.Tag = Nothing Return False End If Return MyBase.SelectFirstColumn() End Function End Class
To reproduce: use the attached sample project. Follow the steps illustrated on the attached gif file. Workaround: keep the vertical scrollbar value and maximum before modifying the child rows and restore them afterwards: private void gridViewParameter_CellValueChanged(object sender, GridViewCellEventArgs e) { if (e.Column.Name == "Select") { this.gridViewParameter.CellValueChanged -= gridViewParameter_CellValueChanged; GridViewRowInfo selectedRowinfo = e.Row; if (selectedRowinfo.HasChildRows()) { int scrollValue = this.gridViewParameter.TableElement.VScrollBar.Value; int scrollMax = this.gridViewParameter.TableElement.VScrollBar.Maximum; this._UpdateUiState(selectedRowinfo.ChildRows, Convert.ToBoolean(selectedRowinfo.Cells["Select"].Value)); this.gridViewParameter.TableElement.VScrollBar.Maximum = scrollMax; this.gridViewParameter.TableElement.VScrollBar.Value = scrollValue; } this.gridViewParameter.CellValueChanged += gridViewParameter_CellValueChanged; } } NOTE: after applying the workaround, there is annoying flickering illustrated on the Flickering.gif file which should be handled if possible.
To reproduce: - Create a hierarchy and set the UseScrollbarsInHierarchy property to true. - Scroll by pressing the thumb in the child template. - The CellClick event is fired when the mouse is released. Workaround: void radGridView1_CellClick(object sender, GridViewCellEventArgs e) { if (e.Column != null) { Console.WriteLine("CellClick"); } }
The idea is that one can bring into view a certain row.
To reproduce: Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Me.ProductsTableAdapter.Fill(Me.NwindDataSet.Products) Dim menu As New ContextMenu() For index = 1 To 4 menu.MenuItems.Add("item" & index) Next Me.ContextMenu = menu End Sub Workaround: Const WM_CONTEXTMENU As Integer = &H7B Public Class Grid Inherits RadGridView Protected Overrides Sub WndProc(ByRef m As Message) If m.Msg = WM_CONTEXTMENU Then Return End If MyBase.WndProc(m) End Sub Public Overrides Property ThemeClassName As String Get Return GetType(RadGridView).FullName End Get Set(value As String) MyBase.ThemeClassName = value End Set End Property End Class
Workaround this.radGridView1.Templates["MyEmptyTemplate"]..AddNewRowPosition = SystemRowPosition.Top Then handle the ViewCellFormatting event and get notifications when the hierarchy tabs are being clicked. private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e) { GridDetailViewCellElement detailCell = e.CellElement as GridDetailViewCellElement; if (detailCell != null) { detailCell.PageViewElement.ItemSelected -= PageViewElement_ItemSelected; detailCell.PageViewElement.ItemSelected += PageViewElement_ItemSelected; } } private void PageViewElement_ItemSelected(object sender, RadPageViewItemSelectedEventArgs e) { if (e.SelectedItem.Text == "MyEmptyTemplate") { this.SetsGridViewTemplate.AddNewRowPosition = SystemRowPosition.Bottom; } }