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); } }
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.
How to reproduce: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.radGridView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; foreach (var col in this.radGridView1.Columns) { col.HeaderTextAlignment = ContentAlignment.MiddleLeft; } } private DataTable GetData() { DataTable dt = new DataTable(); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Date", typeof(DateTime)); dt.Columns.Add("Bool", typeof(bool)); dt.Columns.Add("Bool1", typeof(bool)); dt.Columns.Add("Bool2", typeof(bool)); for (int i = 0; i < 50; i++) { dt.Rows.Add("Name " + i, DateTime.Now.AddMinutes(i), i % 2 == 0 ? true : false, false, false); } return dt; } private void radButton1_Click(object sender, EventArgs e) { this.radGridView1.PrintPreview(); } } Workaround: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; this.radGridView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.radGridView1.PrintCellFormatting += radGridView1_PrintCellFormatting; foreach (var col in this.radGridView1.Columns) { col.HeaderTextAlignment = ContentAlignment.MiddleLeft; } } private void radGridView1_PrintCellFormatting(object sender, PrintCellFormattingEventArgs e) { if (e.Row is GridViewTableHeaderRowInfo && this.radGridView1.RightToLeft == System.Windows.Forms.RightToLeft.Yes) { e.PrintCell.TextAlignment = ContentAlignment.MiddleRight; } } private DataTable GetData() { DataTable dt = new DataTable(); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Date", typeof(DateTime)); dt.Columns.Add("Bool", typeof(bool)); dt.Columns.Add("Bool1", typeof(bool)); dt.Columns.Add("Bool2", typeof(bool)); for (int i = 0; i < 50; i++) { dt.Rows.Add("Name " + i, DateTime.Now.AddMinutes(i), i % 2 == 0 ? true : false, false, false); } return dt; } private void radButton1_Click(object sender, EventArgs e) { this.radGridView1.PrintPreview(); } }
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: - 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: - Add a ColumnGroupsViewDefinition protected override void OnShown(EventArgs e) { base.OnShown(e); VisualStudio2012LightTheme theme = new VisualStudio2012LightTheme(); Telerik.WinControls.ThemeResolutionService.ApplicationThemeName = theme.ThemeName; this.radGridView1.BestFitColumns(); } Workaround: protected override void OnShown(EventArgs e) { base.OnShown(e); this.radGridView1.BestFitColumns(); VisualStudio2012LightTheme theme = new VisualStudio2012LightTheme(); Telerik.WinControls.ThemeResolutionService.ApplicationThemeName = theme.ThemeName; }
To reproduce: - Add a grid to a split panel. - Edit a cell and resize the panel without ending the edit. - Click back in the same cell. Workaround: private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { BaseGridEditor editor = e.ActiveEditor as BaseGridEditor; var element = editor.EditorElement as RadTextBoxEditorElement; if (element != null) { element.TextBoxItem.HostedControl.LostFocus -= HostedControl_LostFocus; element.TextBoxItem.HostedControl.LostFocus += HostedControl_LostFocus; } } private void HostedControl_LostFocus(object sender, EventArgs e) { this.RadGridView1.EndEdit(); }
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