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
Use attached project to reproduce! Another case is when the font size is changed from the settings dialog - in this case, the row height is not adjusted. Workaround: Use the following custom print style: class MyTableViewDefinitionPrintRenderer : TableViewDefinitionPrintRenderer { public MyTableViewDefinitionPrintRenderer(RadGridView grid) : base(grid) { } protected override int GetDataRowHeight(GridViewRowInfo row, TableViewRowLayoutBase rowLayout) { int result = base.GetDataRowHeight(row, rowLayout); int newHeight = 0; if (!(row is GridViewGroupRowInfo)) { foreach (GridViewColumn col in row.ViewTemplate.Columns) { if (col is GridViewRowHeaderColumn || col is GridViewIndentColumn || !col.IsVisible) { continue; } string value = row.Cells[col.Name].Value.ToString(); TableViewCellArrangeInfo info = ((TableViewRowLayout)rowLayout).LayoutImpl.GetArrangeInfo(col); float cellWidth = (float)info.CachedWidth; int currentHeight = TextRenderer.MeasureText(value, this.GridView.PrintStyle.CellFont, new Size((int)cellWidth, 0), TextFormatFlags.WordBreak).Height + this.GridView.Font.Height *4; newHeight = Math.Max(newHeight, currentHeight); } } return Math.Max(newHeight, result); } } class MyPrintStyle :GridPrintStyle { protected override BaseGridPrintRenderer InitializePrintRenderer(RadGridView grid) { return new MyTableViewDefinitionPrintRenderer(grid); } }
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
How can I enter the Value "" (empty string) in the traditional filter system (not Excel like filter).
The grid does not seem to accept an empty string as an argument to "Equals" through the UI.
Ideally I would like to extend the standard filter menu in traditional filtering (and the filter operator drop down in custom filtering dialog) to contain operators "Is Empty" "Is Not Empty" and "Is Null Or Empty", "Is Not Null And Not Empty"
Regards
Erwin
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
When one exports a grid with text written in right-to-left the exported file has all text written in left-to-right.
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
When the pencil icon is clicked the RowValidating event must be fired. WORKAROUND: 1. When clicking the "pencil" icon, the current row is not changed, thus the RowValidating is not fired. A suitable event to cover this case is the CellValidating event which will be triggered when the "pencil" icon is clicked. 2. When the pencil is clicked, save the grid's CurrentRow, set it to null and then set it back to the saved row. This will trigger the RowValidating event and the desired logic will be executed. The downside of this approach is that the event will be triggered twice, because we change the CurrentRow twice. void radGridView1_MouseDown(object sender, MouseEventArgs e) { GridRowHeaderCellElement rowHeader = radGridView1.ElementTree.GetElementAtPoint(e.Location) as GridRowHeaderCellElement; if (rowHeader != null) { GridViewRowInfo saveRow = radGridView1.CurrentRow; radGridView1.CurrentRow = null; radGridView1.CurrentRow = saveRow; } }
Add support for drag and drop operations in column chooser when ColumnGroup view is applied.
Allow changing the header row height when RadGridView is set to ColumnGroupsViewDefinition.