To reproduce set AddNewRowPosition is Bottom and the NewRowEnterKeyMode is EnterMovesToNextCell and add a new row via na UI Workaround: void radGridView1_RowsChanged(object sender, GridViewCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add && radGridView1.CurrentRow is GridViewNewRowInfo) { } }
The column image setting overrides the local image setting. Work around: void grid_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.CellElement is GridCommandCellElement) { if (e.Column.Name == "stationview") { RadButtonElement element = (RadButtonElement)e.CellElement.Children[0]; element.UnbindProperty(RadButtonElement.ImageProperty); element.Image = img; element.DisplayStyle = DisplayStyle.Image; element.ImageAlignment = ContentAlignment.MiddleCenter; } } }
ADD. RadGridView - add functionality to automatically scroll to the needed position, during multiple selection of cells with the traslucent rectangle. MultiSelect = true SelectionMode = cells
ADD. RadGridView - add the ability to group by a certain column and display the groups sorted by the values of another column
To reproduce: 1. Add a RadGridView with two GridViewMultiComboBoxColumns at design time. 2. Bind both of the columns at design time to two different data sources. 3. In the CellEditorInitialized event, set the RadMultiColumnComboBoxElement.AutoSizeDropDownToBestFit property to true. 4. Run the application and open the editor for one of the GridViewMultiComboBoxColumns . You will notice that the columns are automatically sized to fit the content. However, if you open the editor for the other GridViewMultiComboBoxColumn, you will see that columns are not auto sized correctly. Please refer to the attached gif file. Workaround: private void radGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e) { RadMultiColumnComboBoxElement mccbEditor = e.ActiveEditor as RadMultiColumnComboBoxElement; if (mccbEditor != null) { mccbEditor.AutoSizeDropDownToBestFit = true; mccbEditor.PopupOpening -= mccbEditor_PopupOpening; mccbEditor.PopupOpening += mccbEditor_PopupOpening; } } private void mccbEditor_PopupOpening(object sender, CancelEventArgs e) { RadMultiColumnComboBoxElement mccbEditor = sender as RadMultiColumnComboBoxElement; if (mccbEditor != null) { mccbEditor.EditorControl.BestFitColumns(BestFitColumnMode.AllCells); int width = 0; foreach (GridViewColumn c in mccbEditor.EditorControl.Columns) { width += c.Width; } width += mccbEditor.EditorControl.TableElement.VScrollBar.Size.Width; mccbEditor.MultiColumnPopupForm.Size = new Size(width, mccbEditor.MultiColumnPopupForm.Size.Height); } }
Workaround: set the data type of the column to null before saving the layout and after loading it set it with the needed type
To reproduce: DataTable table; public RadForm1() { InitializeComponent(); table = GetTable(); radGridView1.DataSource = table; } private void radButton1_Click(object sender, EventArgs e) { var changes = table.GetChanges(); if (changes == null) { Console.WriteLine("No Changes"); } else { Console.WriteLine("Saved"); foreach (DataRow item in changes.Rows) { Console.WriteLine(item.RowState.ToString()); } } table.AcceptChanges(); } static DataTable GetTable() { DataTable table = new DataTable(); table.Columns.Add("Dosage", typeof(int)); table.Columns.Add("Drug", typeof(string)); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Date", typeof(DateTime)); table.Rows.Add(25, "Indocin", "David", DateTime.Now); table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now); table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now); table.Rows.Add(21, "Combivent", "Janet", DateTime.Now); table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now); table.AcceptChanges(); return table; } Workaround: (this.radGridView1.CurrentRow.DataBoundItem as IEditableObject).EndEdit();
To reproduce: please refer to the attached sample project and gif file illustrating the behavior. Add cell value in the new row and press teh down arrow. Workaround: this.radGridView1.MasterTemplate.SelectLastAddedRow = false; This problem is applicable for OpenEdge as well: http://knowledgebase.progress.com/articles/Article/Telerik-RadGridView-highlights-unnecessary-columns-and-rows-in-batch-mode
To reproduce: public Form1() { InitializeComponent(); DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("ParentId", typeof(int)); for (int i = 0; i < 3; i++) { dt.Rows.Add(i, "Parent" + i, -1); } Random rand = new Random(); for (int i = 3; i < 15; i++) { dt.Rows.Add(i,"Child"+i,rand.Next(0,3)); } this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "Id", "ParentId"); this.radGridView1.DataSource = dt; this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.radGridView1.EnableGrouping = true; this.radGridView1.EnableCustomGrouping = true; this.radGridView1.CustomGrouping+=radGridView1_CustomGrouping; } private void radGridView1_CustomGrouping(object sender, GridViewCustomGroupingEventArgs e) { }
How to reproduce: Create a DPI-aware application and run it on a Windows 10 machine on 125%, the text inside the editors is smaller compared to the text in cells which are not in edit mode. Workaround: private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { BaseInputEditor editor = e.ActiveEditor as BaseInputEditor; if (editor != null) { RadTextBoxItem item = editor.EditorElement.FindDescendant<RadTextBoxItem>(); if (item != null) { item.HostedControl.Font = this.radGridView1.GridViewElement.GetScaledFont(this.radGridView1.GridViewElement.DpiScaleFactor.Height); } } }
To reproduce: please refer to the attached sample project and follow the steps from the attached gif file. 1. Run the project and type "hana" in the second filter cell. You will notice that after a few seconds the input is handled and the grid is filtered. Workaround: use RadVirtualGrid instead. https://docs.telerik.com/devtools/winforms/virtualgrid/overview https://docs.telerik.com/devtools/winforms/virtualgrid/filtering/filtering Second workaround: https://docs.telerik.com/devtools/winforms/gridview/filtering/how-to/filter-on-enter
I might be missing something, but I have Hyperlinks in a column in my RadDatGridView.
I tried searching for a Support document explaining this, but didn't find any.
When the grid is exported to excel all data is coming across, but the column with hyperlink is not
a hyperlink in Excel.
Below is sample of the code used to make the "HyperLink" column in my grid.
radGridView1.DataSource = dtResults;
radGridView1.Columns.Remove("Path");
GridViewHyperlinkColumn col = new GridViewHyperlinkColumn();
radGridView1.Columns.Insert(5, col);
col.Width = 200;
col.FieldName = "Path";
col.HeaderText = "Path";
col.Name = "Path";
Coded used to do the Export....
GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1);
spreadExporter.ExportVisualSettings = true;
SpreadExportRenderer exportRenderer = new SpreadExportRenderer();
spreadExporter.RunExport(filename, exportRenderer);
Thanks.
Roger
Hello,
We are experiencing a strange behaviour of RadGridView set as a self referencing hierarchy when used with Excel filters.
Once we use predefined filter values (both, build-in and custom defined by us) the filter icon is highlitghted when none of the filter is marked. This higlight can be removed when clear filters button of filter popup is used or FilterDescriptors are cleared. If we do not clear the filters manually, and, for instance, sort grid column the application crashes with internal error of the grid. Error reads Object reference not set to an instance of object.
Attached movie will explain it better. I have also attached a ver simple sample project with data (which does not make sense, just for visualisation) that should fail when you repeat steps described above (turn today or last 7 days filter, apply, select no filter, apply and try to sort the same column).
Is there a workaround or specific conditions we need to apply to have it working?
Thanks for your advice.
I'm also attaching errors details:
Workaround: use the following custom editor: using System; using Telerik.WinControls.UI; namespace radGridView_MultipleFilters { public class CustomRadMultiColumnComboBoxElement : RadMultiColumnComboBoxElement { protected override Type ThemeEffectiveType { get { return typeof(RadMultiColumnComboBoxElement); } } public GridViewDataColumn DisplayColumn { get { string displayMember = this.DisplayMember; if (string.IsNullOrEmpty(displayMember)) { for (int i = 0; i < this.MultiColumnPopupForm.EditorControl.Columns.Count; i++) { if (this.MultiColumnPopupForm.EditorControl.Columns[i].DataType == typeof(string)) { displayMember = this.MultiColumnPopupForm.EditorControl.Columns[i].FieldName; break; } } if (this.MultiColumnPopupForm.EditorControl.Columns.Count > 0 && string.IsNullOrEmpty(displayMember)) { displayMember = this.MultiColumnPopupForm.EditorControl.Columns[0].FieldName; } } DisplayMember = displayMember; GridViewDataColumn[] columns = this.MultiColumnPopupForm.EditorControl.Columns.GetColumnByFieldName(displayMember); if (columns.Length > 0) { return columns[0]; } return null; } } protected override object FindItemExact(string text) { int index = this.FindItemIndexExact(text); if (index != -1) { return this.EditorControl.ChildRows[index]; } return null; } protected override void SetActiveItem(string text) { int rowIndex = this.FindItemIndexExact(text); if (rowIndex != -1) { this.EditorControl.CurrentRow = this.EditorControl.ChildRows[rowIndex]; this.Select(this.Text.Length, 0); } } protected override int FindItemIndexExact(string text) { GridViewRowInfo rowInfo = this.FindItemExact(text, this.DisplayColumn.Name); if (rowInfo != null) { return rowInfo.Index; } return -1; } protected override GridViewRowInfo FindItemExact(string text, string field) { GridViewDataColumn[] foundColumns = this.EditorControl.Columns.GetColumnByFieldName(field); if (foundColumns.Length > 0) { for (int i = 0; i < this.EditorControl.ChildRows.Count; i++) { object element = this.EditorControl.ChildRows[i].Cells[foundColumns[0].Name].Value; string elementText = Convert.ToString(element); if (!string.IsNullOrEmpty(elementText) && elementText.Equals(text, this.EditorControl.MasterTemplate.CaseSensitive ? StringComparison.InvariantCulture : StringComparison.InvariantCultureIgnoreCase)) { return this.EditorControl.ChildRows[i]; } } } return null; } } }
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.
IMPROVE. RadGridView - when sorting grouped combo box column the DisplayMemberSort is not taken into consideration
When a Right-To-Left grid is printed the text of all print cells should be drawn with the StringFormatFlags.DirectionRightToLeft. Example: RadGridView with RightToLeft set to Yes A decimal column with negative values the values in the decimal column are drawn as 96-, 88- etc if this grid is printed the values will be -96, -88 Workaround: http://www.telerik.com/community/forums/radprintdocument-from-a-grid-wrong-format-when-right-to-left-true-in-grid
Implement "Tag" and "Name" properties into the GridViewColumnGroup.
RadGridView is throwing exception when loading layout that contains a GroupDescriptor with predefined Format with Aggregate function. Steps to reproduce: 1. Add GroupDescriptor: Dim descriptor As New GroupDescriptor descriptor.GroupNames.Add("column3", System.ComponentModel.ListSortDirection.Ascending) descriptor.Aggregates.Add("Sum(column3)") descriptor.Format = "{0}: {1} Total montant : {2:c2}" Me.RadGridView1.GroupDescriptors.Add(descriptor) 2. Save Layout 3. Load Layout