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;
Please refer to the attached sample project and follow the steps illustrated on the attached gif file. Workaround: subscribe to the CellBeginEdit event and focus the grid: public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); this.radGridView1.CellBeginEdit += radGridView1_CellBeginEdit; } private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) { this.radGridView1.Focus(); } }
To reproduce: - Create a new Visual Studio project with a single form. - Add a RadGridView control to the form. - Add a child Template to the RadGridView. - In the properties of this child template, enable AutoExpand Groups. - Close the form editor and re-open.
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.
To reproduce: 1. Add a UserControl and drop a RadGridView in it. 2. Use the following code: public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); ColumnGroupsViewDefinition view = new ColumnGroupsViewDefinition(); this.radGridView1.ViewDefinition = view; view.ColumnGroups.Add(new GridViewColumnGroup("Group")); view.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow() ); GridViewTextBoxColumn col = new GridViewTextBoxColumn("Col1"); this.radGridView1.Columns.Add(col); view.ColumnGroups[0].Rows[0].ColumnNames.Add("Col1"); } } 3. Drag the UserControl from the Toolbox to the form. Workaround: set the ViewDefinition property after all columns are added.
To reproduce: - Show a message box in the CellValidating event handler. - Start the application, edit a cell and directly press the vertical scroll bottom arrow.
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.
The GridViewNewRowInfo is in modified state when the DefaultValuesNeeded event is used. This causes the UserAddingRow event to be fired. Workaround: void radGridView1_DefaultValuesNeeded(object sender, GridViewRowEventArgs e) { e.Row.Cells["SearchType"].Value = "BI"; FieldInfo fieldInfo = typeof(GridViewRowInfo).GetField("state", BindingFlags.NonPublic | BindingFlags.Instance); BitVector32 state = (BitVector32)fieldInfo.GetValue(e.Row); state[2] = false; fieldInfo.SetValue(e.Row, state); e.Row.InvalidateRow(); }
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(); } }
If you refresh an object set property of entity context, the RadGridView is not updated. The sample code below does not work: this.radGridView1.DataSource = entities.Countries; int maxId = (from c in entities.Countries orderby c.Id descending select c.Id).First(); Country country = new Country(); country.Id = maxId + 1; country.Name = Path.GetRandomFileName(); entities.Countries.AddObject(country); entities.SaveChanges(System.Data.Objects.SaveOptions.AcceptAllChangesAfterSave); entities.Refresh(System.Data.Objects.RefreshMode.StoreWins, entities.Countries);
Load-On-Demand - full lazy mode support
Steps to reproduce: 1. Place a grid on a form and add several columns. 2. Set a ColumnGroupsViewDefinition to the grid and resize the columns so the horizontal scroll bar appears. 3. Add a button and on its click call the PrintPreview method of the grid. You will see that the horizontal scroll bar of the grid will disappear. Workaround:workaround it by increasing and decreasing the width of a single column with 1 pixel right after you call the Print method of the print document. document.Print() grid.Columns(0).Width += 1 grid.Columns(0).Width -= 1
To reproduce: - Add CommandColumn to the grid - Observe the size of the button in the newrow row Workaround: - Add some padding in the cell formating event void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e) { GridViewNewRowInfo row = e.Row as GridViewNewRowInfo; GridCommandCellElement cell = e.CellElement as GridCommandCellElement; if (row != null && cell != null) { cell.CommandButton.SetDefaultValueOverride(RadItem.MarginProperty, new System.Windows.Forms.Padding(0,0,1,0)); } }
1. Create a new project with RadGridView and setup hierarchy. 2. Run the project. 3. Select the "add new row" and click Escape key to leave edit mode. 4. Press Tab several times. You will see that the current cell is indistinguishable.
I have a form with a RadGridView that's bound to an list of Custom Objects. Each custom object has a property that is also a list of custom objects of a different class. I added a child template to the main grid for this property and created a relation between the two. Everything displays nicely and I can add new rows to the main grid. However, when I attempt to add a new row to one of the child grids, the row does not get added.
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