Please find attached a sample project. 1. Select the new row and activate te editor. 2. Do not enter any value and click outside the new row. The exception is thrown. Workaround: bind directly to the query result: this.radGridView1.DataSource = (from p in context.Customers select p).ToList();
To reproduce: -Create a new ColumnGroupsViewDefinition and pin the first group. - Asign the view to the grid. Workaround: Pin the group after the view is asigned.
To reproduce: use the attached sample project Workaround: refresh the template when updating the data source: this.radGridView1.MasterTemplate.Refresh();
To reproduce: - Use RowFormatting to change the font style to bold. - Call the BestFitColumns method.
To reproduce: - Add a grid with some columns at design time. - Open the designer code and you will notice the TableViewDefinition. Workaround: Manually delete the TableViewDefinition.
To reproduce: Sub New() InitializeComponent() Dim items As New List(Of WorkOrder) For index = 1 To 56 items.Add(New WorkOrder(index, "Item" & index, 0)) Next Dim rand As New Random For index = 57 To 500 items.Add(New WorkOrder(index, "Item" & index, rand.Next(1, 56))) Next Me.RadGridView1.Relations.AddSelfReference(Me.RadGridView1.MasterTemplate, "Id", "ParentId") Me.RadGridView1.DataSource = items Me.RadGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill Me.RadGridView1.EnablePaging = True Me.RadGridView1.PageSize = 20 End Sub Public Class WorkOrder Private _id As Integer Private _name As String Private _parentId As Integer Public Sub New(id As Integer, name As String, parentId As Integer) Me._id = id Me._name = name Me._parentId = parentId End Sub Public Property Id() As String Get Return _id End Get Set(ByVal value As String) _id = value End Set End Property Public Property Name() As String Get Return _name End Get Set(ByVal value As String) _name = value End Set End Property Public Property ParentID() As Integer Get Return _parentId End Get Set(ByVal value As Integer) _parentId = value End Set End Property End Class Workaround: use standard hierarchy: http://docs.telerik.com/devtools/winforms/gridview/hierarchical-grid/hierarchy-of-one-to-many-relations
Note: as a result ArgumentException is thrown when accessing a cell value. To reproduce: private DataTable dt; private GridViewRowInfo selectedRow; public Form1() { InitializeComponent(); PopulateGrid(); PopulateGrid(); } private void PopulateGrid() { dt = new DataTable(); dt.Columns.Add("Version No", typeof(Int32)); DataRow dr = dt.NewRow(); dr["Version No"] = 2385; dt.Rows.Add(dr); this.radGridView1.DataSource = dt; MessageBox.Show(selectedRow.Cells[0].ColumnInfo.Name); MessageBox.Show(selectedRow.Cells[0].Value.ToString()); //This will error on the second time through } private void radGridView1_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e) { //This event is not firing on the second population of the grid in the new Telerik version. //In the old version, it did if (!this.radGridView1.CurrentRow.IsSystem && !this.radGridView1.CurrentRow.HasChildRows() && this.radGridView1.CurrentRow.Cells.Count > 0) selectedRow = this.radGridView1.CurrentRow; } Workaround: use the RadGridView.CurrentRow property directly when accessing the cell value.
To reproduce: - Add some columns to a grid and make one read-only. - Add a value to the new row then click the read-only cell. - Click outside of the grid (focus another control). - The new row is not added. Workaround: radgridView1.EndEdit() radgridView1.MasterView.TableAddNewRow.EndAddNewRow()
Please refer to the attached sample project. Workaround: public class MyGridCheckBoxCellElement : GridCheckBoxCellElement { public MyGridCheckBoxCellElement(GridViewColumn column, GridRowElement row) : base(column, row) { } protected override Type ThemeEffectiveType { get { return typeof(GridCheckBoxCellElement); } } public override bool IsCompatible(GridViewColumn data, object context) { GridViewCheckBoxColumn col = data as GridViewCheckBoxColumn; if (col != null) { return col.ThreeState == ((RadCheckBoxEditor)this.Editor).ThreeState; } return base.IsCompatible(data, context); } } private void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e) { if (e.CellType == typeof(GridCheckBoxCellElement)) { e.CellElement = new MyGridCheckBoxCellElement(e.Column, e.Row); } }
Use the attached sample project. Workaround: hide the columns programmatically at run time.
Please refer to the attached gif file. Workaround: specify the MinimumSize property of the grid and its parent container to have a greater width than the DesiredSize of the group panel.
Workaround: instead of using the default alternating row color for the mentioned themes, use the override theme setting in the CellFormatting event: http://www.telerik.com/help/winforms/tpf-override-theme-settings-at-run-time.html private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) { if (e.Row is GridViewDataRowInfo) { if (e.RowIndex % 2 == 0) { e.CellElement.SetThemeValueOverride(LightVisualElement.BackColorProperty, Color.Red, ""); e.CellElement.SetThemeValueOverride(LightVisualElement.DrawFillProperty, true, ""); e.CellElement.SetThemeValueOverride(LightVisualElement.GradientStyleProperty, GradientStyles.Solid, ""); } else { e.CellElement.ResetThemeValueOverride(LightVisualElement.BackColorProperty, ""); e.CellElement.ResetThemeValueOverride(LightVisualElement.DrawFillProperty, ""); e.CellElement.ResetThemeValueOverride(LightVisualElement.GradientStyleProperty, ""); } } }
Steps to reproduce: - Create a hierarchy grid with four child templates. - Add group descriptors for each template in code - add it before setting the data source of the tempaltes. Workaround: Add the groups descriptor after the data source of the template is set.
Selected rows/cells of RadGridView should not be exporting with their selected visual styles and this is why when the export starts all selected rows are cleared. At the end of export selection is restored. This is the reason Validating/ed and SelectionChanged events are fired when exporting with RadGridView exports. Workaround: Unsubscribe from these events before the export starts and subscribe to them again when export operation is completed. this.radGridView1.RowValidating -= radGridView1_RowValidating; this.radGridView1.SelectionChanged -= radGridView1_SelectionChanged; // Export ExportToExcelML excelMLExporter = new ExportToExcelML(this.radGridView1); excelMLExporter.ExportVisualSettings = true; excelMLExporter.RunExport(fileName); this.radGridView1.RowValidating += radGridView1_RowValidating; this.radGridView1.SelectionChanged += radGridView1_SelectionChanged;
Workaround: private void grid_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.ShiftKey) { this.grid.MasterTemplate.ListSource.BeginUpdate(); } } private void grid_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.ShiftKey) { this.grid.MasterTemplate.ListSource.EndUpdate(); } }
How to reproduce: the MCCB column needs to be set with AutoCompleteMode.SuggestAppend public partial class Form1 : Form { private List<MyComboItem> listItems; public Form1() { InitializeComponent(); this.listItems = new List<MyComboItem>(); listItems.Add(new MyComboItem("Item1", "This is test for item1")); listItems.Add(new MyComboItem("Atn time", "This is test for item2")); listItems.Add(new MyComboItem("Bc chars", "This is test for item3")); listItems.Add(new MyComboItem("Elsa", "This is test for item4")); listItems.Add(new MyComboItem("Elementary", "This is test for item4")); GridViewMultiComboBoxColumn gridviewColumn1 = radGridView1.Columns[0] as GridViewMultiComboBoxColumn; if (gridviewColumn1 != null) { gridviewColumn1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; gridviewColumn1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown; gridviewColumn1.DataSource = listItems; } } } public class MyComboItem { public string Code { get; set; } public string Description { get; set; } public MyComboItem(string code, string description) { this.Code = code; this.Description = description; } } Workaround: handle the CellEditorInitialized and remove the selection private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { if (radGridView1.CurrentColumn is GridViewMultiComboBoxColumn) { RadMultiColumnComboBoxElement editor = e.ActiveEditor as RadMultiColumnComboBoxElement; if (editor != null && e.Row is GridViewNewRowInfo) { editor.SelectedIndex = -1; } } }
To reproduce: - Bind the grid to a list of the following objects: public class Test { private Status _Status = Status.Value1; public Status Status { get { return _Status; } set { _Status = value; } } private string _Name = ""; public string Name { get { return _Name; } set { _Name = value; } } } public enum Status { Value1, Value2, Value3 } - Group Name column. - Open at least one group. - Close grouping. - Group status column. - Try to open status group. Workaround: GridViewComboBoxColumn col = radGridView1.Columns[0] as GridViewComboBoxColumn; col.DisplayMemberSort = true;
Workaround: subscribe to the PageChanged event and update the scroll range. private void RadGridView1_PageChanged(object sender, EventArgs e) { this.RadGridView1.TableElement.RowScroller.UpdateScrollRange(); }
To reproduce: use the following code snippet and try to delete a child row: public Form1() { InitializeComponent(); DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("ParentId", typeof(int)); dt.Columns.Add("Name", typeof(string)); for (int i = 0; i < 5; i++) { dt.Rows.Add(i, null, "Item" + i); } Random rand = new Random(); for (int i = 5; i < 30; i++) { dt.Rows.Add(i, rand.Next(0, 5), "Child item" + i); } this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "Id", "ParentId"); this.radGridView1.DataSource = dt; this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; this.radGridView1.UserDeletingRow += radGridView1_UserDeletingRow; } private void radGridView1_UserDeletingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { if (this.radGridView1.CurrentRow.HasChildRows()) { DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete this row?", "Delete Row confirmation", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.No) { e.Cancel = true; } } } Workaround: use the RadGridView.CurrentRow.ChildRows.Count property.
To reproduce: - Set the row height to 1000. - Call the grid PrintPreview method. As workaround one can set the MaxHeight of the rows prior printing.