Workaround: use the CellEndEdit event to work around the navigation issue: private void CellEndEdit(object sender, GridViewCellEventArgs e) { this.grid.CurrentRow = null; this.grid.CurrentRow = e.Row; }
You cannot save the current row by performing the DataContext's SaveChanges method when the RadGridView is bound to IQueryable. The code should look like this to work properly: protected sealed override void BindingNavigator_SaveAction(object sender) { try { this.countriesRadGridView.EndEdit(); BindingSource bs = this.countriesRadGridView.DataSource as BindingSource; bs.EndEdit(); this.DataContext.SaveChanges(); base.FireUpdateData(); } catch (Exception Ex) { string exMessage = Ex.Message; MessageBox.Show(exMessage); } }
Currently when clicking on the expander cell RadGridView scrolls to the currently selected column which in some cases causes unnecessary scrolling Workaround: public class CustomGridControl : RadGridView { public override string ThemeClassName { get { return typeof(RadGridView).FullName; } set { } } protected override void OnMouseDown(MouseEventArgs e) { RadElement element = this.ElementTree.GetElementAtPoint(e.Location); GridGroupExpanderCellElement expanderCell = element as GridGroupExpanderCellElement; if (expanderCell == null) { expanderCell = element.FindAncestor<GridGroupExpanderCellElement>(); } if (expanderCell != null) { this.TableElement.BeginUpdate(); expanderCell.RowInfo.IsExpanded = !expanderCell.RowInfo.IsExpanded; this.TableElement.HScrollBar.Value = 0; this.TableElement.EndUpdate(); return; } base.OnMouseDown(e); } }
If you have your grid bound to a table with a single string column, changing the DataType of the resulted column in RadGridView to int, should change the way the column is sorted.
To reproduce: use the following code snippet and follow the steps from the attached gif file. public Form1() { InitializeComponent(); List<Item> items = new List<Item>(); for (int i = 1; i < 10; i++) { items.Add(new Item(i, 0, "Item" + i)); } Random rand = new Random(); for (int i = 10; i < 50; i++) { items.Add(new Item(i, rand.Next(1, 10), "Item" + i)); } this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "Id", "ParentId"); this.radGridView1.DataSource = items; this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; this.radGridView1.EnableFiltering = true; this.radGridView1.ShowHeaderCellButtons = true; } public class Item { public int Id { get; set; } public int ParentId { get; set; } public string Name { get; set; } public Item(int id, int parentId, string name) { this.Id = id; this.ParentId = parentId; this.Name = name; } } Workaround: use the basic filtering
To reproduce Switch to Right-to-Left mode. Look at the top left corner of the grid. Workaround this.radGridView1.TableElement.Children[0].Margin = new Padding(-2, 0, 0, 0);
GridViewMultiComboBoxColumn accepts only valid values according to the specified ValueMember. By entering "A" in the RadMultiColumnComboBoxElement editor in the filter cell, you can not filter the main RadGridView with all cells that starts with "A" as "A" is not a valid value according to the GridViewMultiComboBoxColumn.ValueMember property. Workaround: The ContextMenuOpening can be used to hide the irrelevant filter members
To reproduce: -add hierarchical RadGriddView with one parent template and several child templates; -set TableElement.PageViewMode to PageViewMode.ExplorerBar; Selection for different templates is not performed correcltly. Workaround: use custom GridDataRowBehavior: BaseGridBehavior gridBehavior = this.radGridView1.GridBehavior as BaseGridBehavior; gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo)); gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo), new RowSelectionGridBehavior()); public class RowSelectionGridBehavior : GridDataRowBehavior { protected override bool OnMouseDownLeft(MouseEventArgs e) { GridDataRowElement row = this.GetRowAtPoint(e.Location) as GridDataRowElement; if (row != null) { row.RowInfo.IsSelected = true; row.RowInfo.IsCurrent = true; return true; } return base.OnMouseDownLeft(e); } }
Workaround: this.radGridView1.XmlSerializationInfo.SerializationMetadata.Add(typeof(GridViewSummaryItem), "AggregateExpression", DesignerSerializationVisibilityAttribute.Content);
Workaround: custom RadGridViewDragDropService and an override of the HandleMouseMove method, please check the attached project
The control just does not appear in the destination solution.
To reproduce: - Open the hierarchy example in the demo application. - Select Auto-GenratedDataSet and add a new row in the third level template. - Select Manually generated for Bound Mode and then re-select Auto-GenratedDataSet - Try to add new row again. Yo will notice that the new row is not added. Workaround: class MyNewRowBehavior : GridNewRowBehavior { protected override bool ProcessEnterKey(KeyEventArgs keys) { if (this.GridControl.IsInEditMode) { GridViewSynchronizationService.SuspendEvent(this.GridControl.CurrentRow.ViewTemplate, KnownEvents.CurrentChanged); bool result = base.ProcessEnterKey(keys); GridViewSynchronizationService.ResumeEvent(this.GridControl.CurrentRow.ViewTemplate, KnownEvents.CurrentChanged); return result; } else { return base.ProcessEnterKey(keys); } } protected override bool ProcessTabKey(KeyEventArgs keys) { if (this.GridControl.IsInEditMode) { GridViewSynchronizationService.SuspendEvent(this.GridControl.CurrentRow.ViewTemplate, KnownEvents.CurrentChanged); bool result = base.ProcessTabKey(keys); GridViewSynchronizationService.ResumeEvent(this.GridControl.CurrentRow.ViewTemplate, KnownEvents.CurrentChanged); this.Navigator.SelectNextColumn(); return result; } else { return base.ProcessTabKey(keys); } } } The default behavior can be changed as follows: ((BaseGridBehavior)radGridView1.GridBehavior).UnregisterBehavior(typeof(GridViewNewRowInfo)); ((BaseGridBehavior)radGridView1.GridBehavior).RegisterBehavior(typeof(GridViewNewRowInfo), new MyNewRowBehavior());
How to handle this case: Subscribe to the CellValidating event and add logic for validation. For example: If e.Value Is Nothing Then e.Cancel = True End If Additionally you can handle the DataError event to handle cases where users are trying to submit invalid data through the grid to its data source. Finally, you can subscribe to the ContextMenuOpening event where to hide the "Clear value" item from context menu with following code snippet: For i As Integer = 0 To e.ContextMenu.Items.Count - 1 If e.ContextMenu.Items(i).Text = "Clear Value" Then e.ContextMenu.Items(i).Visibility = Telerik.WinControls.ElementVisibility.Collapsed End If Next
The GridTimePickerEditor format is not correctly taken from the GridDateTimeColumn FormatString property. Workaround: Use the Format and CustomFormat properties.
To reproduce: Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.CustomersTableAdapter.Fill(Me.NwindDataSet.Customers) Dim view As New ColumnGroupsViewDefinition() view.ColumnGroups.Add(New GridViewColumnGroup("Customer Contact")) view.ColumnGroups.Add(New GridViewColumnGroup("Details")) view.ColumnGroups(1).Groups.Add(New GridViewColumnGroup("Address")) view.ColumnGroups(1).Groups.Add(New GridViewColumnGroup("Contact")) view.ColumnGroups(0).Rows.Add(New GridViewColumnGroupRow()) view.ColumnGroups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("CompanyName")) view.ColumnGroups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("ContactName")) view.ColumnGroups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("ContactTitle")) view.ColumnGroups(1).Groups(0).Rows.Add(New GridViewColumnGroupRow()) view.ColumnGroups(1).Groups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("Address")) view.ColumnGroups(1).Groups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("City")) view.ColumnGroups(1).Groups(0).Rows(0).Columns(1).RowSpan = 40 view.ColumnGroups(1).Groups(0).Rows(0).Columns.Add(Me.RadGridView1.Columns("Country")) view.ColumnGroups(1).Groups(1).Rows.Add(New GridViewColumnGroupRow()) view.ColumnGroups(1).Groups(1).Rows(0).Columns.Add(Me.RadGridView1.Columns("Phone")) view.ColumnGroups(1).Groups(1).Rows(0).Columns.Add(Me.RadGridView1.Columns("Fax")) RadGridView1.ViewDefinition = view Dim summaryItem As New GridViewSummaryItem() summaryItem.Name = "Address" summaryItem.Aggregate = GridAggregateFunction.Count Dim summaryRowItem As New GridViewSummaryRowItem() summaryRowItem.Add(summaryItem) Me.RadGridView1.SummaryRowsTop.Add(summaryRowItem) Me.RadGridView1.MasterView.SummaryRows(0).PinPosition = PinnedRowPosition.Top Me.RadGridView1.MasterView.SummaryRows(0).Height = 20 End Sub Workaround: use the ViewCellFormatting event and set the TextAlignment property to MiddleTop for the summary cells.
1. Load the ControlDefault theme in Visual Style Builder 2. Edit the cell style and try to disable the cell border when RadGridView is not focused and the HideSelection property is set to true. 3. You cannot because the HotTracking property is not updated correctly for grid cells. Workaround: void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement.IsCurrent && !e.CellElement.RowElement.HotTracking) { e.CellElement.DrawBorder = false; e.CellElement.DrawFill = false; } else { e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local); e.CellElement.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local); } }
For now you can manually add the columns to the ExcelFilteredColumns collection when the filters are added in code: FilterDescriptor fd = new FilterDescriptor("Value", Telerik.WinControls.Data.FilterOperator.IsEqualTo, "B"); fd.IsFilterEditor = true; radGridView1.FilterDescriptors.Add(fd); this.radGridView1.MasterTemplate.ExcelFilteredColumns.Add( this.radGridView1.Columns[0] );
ADD. RadGridView - add export of ViewDefiniton 1. Add export functionality for ColumnGroupsViewDefinition 2. Add export functionality for HtmlViewDefinition
Currently each grid is exported in a separate excel file with one or more sheets. It will be good to add the possibility to export a grid to a separate sheet in an existing file.
Add the ability to print all levels of a hierarchical RadGridView.