How to reproduce:
Create a grid with enabled filtering and open the excel-like filter popup of a DateTime column.
Workaround:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.radGridView1.DataSource = this.GetData();
this.radGridView1.EnableFiltering = true;
this.radGridView1.ShowFilteringRow = true;
this.radGridView1.ShowHeaderCellButtons = true;
this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
this.radGridView1.FilterPopupInitialized += RadGridView1_FilterPopupInitialized;
}
private void RadGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
{
RadDateFilterPopup popup = e.FilterPopup as RadDateFilterPopup;
if (popup != null && popup.Width < 300)
{
popup.Width += 100;
popup.Height += 100;
}
}
private object GetData()
{
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Bool", typeof(bool));
dt.Columns.Add("Date", typeof(DateTime));
for (int i = 0; i < 100; i++)
{
dt.Rows.Add(i, "Name " + i, i % 2 == 0, DateTime.Now.AddDays(1));
}
return dt;
}
}
To reproduce: please refer to the attached sample project. Click the button several times to add 3-4000 rows and toggle the checkbox. You will notice that every time you add new rows and hide the column it takes a long time. The more rows you have, the more time it requires.
Workaround:
radGridView1.MasterTemplate.BeginUpdate();
radGridView1.Columns[0].IsVisible = checkBox1.Checked;
radGridView1.MasterTemplate.EndUpdate();
Steps to reproduce: 1. Set DPI scale to 150 of all screens 2. Run attached sample 3. The column`s width is not calculated correctly.
Workaround:
private void RadForm1_Load(object sender, EventArgs e)
{
this.categoriesTableAdapter.Fill(this.nwindDataSet.Categories);
this.productsTableAdapter.Fill(this.nwindDataSet.Products);
radGridView1.AutoGenerateHierarchy = true;
radGridView1.DataSource = this.nwindDataSet;
radGridView1.DataMember = "Categories";
radGridView1.Rows[0].IsExpanded = !radGridView1.Rows[0].IsExpanded;
radGridView1.Rows[0].IsExpanded = !radGridView1.Rows[0].IsExpanded;
}
Image expandedSign;
Image collapsedSign;
private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
GridGroupExpanderCellElement expanderCell = e.CellElement as GridGroupExpanderCellElement;
if (expanderCell != null)
{
if (expandedSign == null && expanderCell.Expander.SignImage != null && e.Row.IsExpanded == false)
{
expandedSign = expanderCell.Expander.SignImage.Clone() as Image;
}
if (collapsedSign == null && expanderCell.Expander.SignImage != null && e.Row.IsExpanded == true)
{
collapsedSign = expanderCell.Expander.SignImage.Clone() as Image;
}
if (expandedSign != null && collapsedSign != null)
{
expanderCell.Expander.SignImage = null;
}
if (e.Row.IsExpanded)
{
expanderCell.Expander.Image = collapsedSign;
}
else
{
expanderCell.Expander.Image = expandedSign;
}
expanderCell.Expander.ImageLayout = ImageLayout.None;
expanderCell.Expander.DrawImage = true;
expanderCell.Expander.ImageAlignment = ContentAlignment.TopLeft;
}
}
To reproduce: please refer to the attached sample project. Workaround: this.radGridView1.TableElement.ScrollToRow(this.radGridView1.RowCount-1);
Attached project for reproducing. Workaround: var column = radGridView1.Columns[2] as GridViewDecimalColumn; var format = column.FormatString; column.FormatString = ""; column.ExcelExportType = DisplayFormatType.Currency; //export the grid column.FormatString = format;
Please refer to the attached sample project and follow the steps illustrated in the attached gif file.
To reproduce:
- Add a grid to a PageView and add the pageView to a dock window at run time.
- The grid should not be visible.
- Set your DPI setting to 150%
Workaround:
class MyViewDefinition : TableViewDefinition
{
public override IRowView CreateViewUIElement(GridViewInfo viewInfo)
{
return new MyTableElement();
}
}
class MyTableElement : GridTableElement
{
public override void DpiScaleChanged(SizeF scaleFactor)
{
if (this.ViewTemplate != null)
{
base.DpiScaleChanged(scaleFactor);
}
}
protected override Type ThemeEffectiveType
{
get { return typeof(GridTableElement); }
}
}
//use the above definition like this:
radGridView1.ViewDefinition = new MyViewDefinition();
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)
{
}
To reproduce: 1. Bind RadGridView to the Northwind.Customers table. 2. Activate the editor for some of the cells from the CustomerID column. 3. Enter "ALFKI" which already exists. The DataError event is supposed to be fired in this case. If you set the GridViewDataErrorEventArgs.ThrowException argument to true the exception is supposed to be thrown. However, nothing happens. Please refer to the attached sample project.
How to reproduce check the attached project:
Workaround: Create a custom spread export renderer
public class MySpreadExportRenderer : SpreadExportRenderer
{
public override void AddWorksheet(string sheetName)
{
string name = "";
Workbook wb = (Workbook)typeof(SpreadExportRenderer).GetField("workbook", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
if (sheetName == null || sheetName == string.Empty)
{
name = "Sheet_" + (wb.Worksheets.Count + 1);
}
else
{
name = sheetName;
}
if (wb.Worksheets.Where(w => w.Name == name).ToList().Count == 0)
{
base.AddWorksheet(sheetName);
}
else
{
typeof(SpreadExportRenderer).GetField("worksheet", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this, wb.Worksheets.Add());
}
}
}
Please refer to the attached sample project and follow the steps in the gif file.
1. Open two MDI child forms.
2. Activate the first form and right click on the grid in order to show the context menu and add a shortcut to the menu item. Press Ctrl+N in order to add some new rows to the first grid.
3. Activate the second form and right click on the grid in order to show the context menu and add a shortcut to the menu item. Press Ctrl+N in order to add some new rows to the second grid. However, you will notice that the first several shortcuts combinations are executed for the first grid and then for the active second grid.
Workaround: clear the shortcut when the form is deactivated:
this.Deactivate += GridForm_Deactivate;
private void GridForm_Deactivate(object sender, EventArgs e)
{
item.Shortcuts.Clear();
}
private void GridForm_Activated(object sender, EventArgs e)
{
this.ActiveControl = this.radGridView1;
}
RadMenuItem item = new RadMenuItem();
private void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
{
item.Text = "insert row";
item.Shortcuts.Add(new RadShortcut(Keys.Control, Keys.N));
item.Click += item_Click;
e.ContextMenu.Items.Add(item);
}
To reproduce: please refer to the attached gif file.
Workaround:
public RadForm1()
{
InitializeComponent();
this.radGridView1.CellClick+=radGridView1_CellClick;
}
private void radGridView1_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
if (e.Column is Telerik.WinControls.UI.GridViewRowHeaderColumn)
{
this.radGridView1.CloseEditor();
}
}
Workaround:
Friend Class MyRadGridView
Inherits RadGridView
Public Overrides Property ThemeClassName As String
Get
Return GetType(RadGridView).FullName
End Get
Set(value As String)
MyBase.ThemeClassName = value
End Set
End Property
Protected Overrides Function CreateGridViewElement() As RadGridViewElement
Return New MyRadGridViewElement()
End Function
End Class
Friend Class MyRadGridViewElement
Inherits RadGridViewElement
Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
Get
Return GetType(RadGridViewElement)
End Get
End Property
Protected Overrides Function CreateGroupPanelElement() As GroupPanelElement
Return New MyGroupPanelElement()
End Function
End Class
Friend Class MyGroupPanelElement
Inherits GroupPanelElement
Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
Get
Return GetType(GroupPanelElement)
End Get
End Property
Protected Overrides Function ArrangeOverride(finalSize As SizeF) As SizeF
Dim clientRect As RectangleF = Me.GetClientRectangle(finalSize)
Dim sizeGripRect As New RectangleF(clientRect.X, clientRect.Bottom - Me.SizeGrip.DesiredSize.Height, clientRect.Width, Me.SizeGrip.DesiredSize.Height)
Me.SizeGrip.Arrange(sizeGripRect)
clientRect.Height -= Me.SizeGrip.DesiredSize.Height
Dim groupHeaderRect As New RectangleF(clientRect.X, clientRect.Y, Me.Header.DesiredSize.Width, clientRect.Height)
Me.Header.Arrange(groupHeaderRect)
clientRect.Width -= Me.Header.DesiredSize.Width
Dim scrollViewRect As New RectangleF(clientRect.X + Me.Header.DesiredSize.Width, clientRect.Y, clientRect.Width, clientRect.Height)
If scrollViewRect.Width > 20 Then
Me.ScrollView.Arrange(scrollViewRect)
End If
Return finalSize
End Function
End Class
Steps to reproduce:
1. Add RadGridView and populate with data
2. Show the context menu many times. Sometimes the popup is not shown correctly.
If you click again, the popup is visible correctly.
Workaround:
Set the AnimationEnabled property to false or the AnimationType property to None. Here is the code snippet how can be achieve it:
//Set the AnimationEnabled to false
void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
{
RadDropDownMenu contextMenu = e.ContextMenu as RadDropDownMenu;
contextMenu.AnimationEnabled = false;
}
//Set the AnimationType to None
void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
{
RadDropDownMenu contextMenu = e.ContextMenu as RadDropDownMenu;
contextMenu.AnimationType = PopupAnimationTypes.None;
}
How to reproduce: check the attached video
Workaround: disable pinning of the last row when it is in a group
public partial class Form1 : Form
{
DataTable dt;
public Form1()
{
InitializeComponent();
this.radGridView1.DataSource = this.GetData();
this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
this.radGridView1.ContextMenuOpening += RadGridView1_ContextMenuOpening;
}
private void RadGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
{
GridRowHeaderCellElement header = e.ContextMenuProvider as GridRowHeaderCellElement;
if (header != null && header.RowInfo.Group != null)
{
var notPinned = header.RowInfo.Group.GroupRow.ChildRows.Where(r => r.IsPinned == false).ToList();
if (notPinned.Count <= 1)
{
e.ContextMenu.Items.RemoveAt(0);
e.ContextMenu.Items.RemoveAt(0);
}
}
}
private DataTable GetData()
{
dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Date", typeof(DateTime));
dt.Columns.Add("Bool", typeof(bool));
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 2; j++)
{
dt.Rows.Add(i, "Name " + i + " " + j, DateTime.Now.AddDays(i), i % 2 == 0);
}
}
return dt;
}
}
How to reproduce:
public partial class Form1 : Form
{
DataTable dt;
public Form1()
{
InitializeComponent();
this.radGridView1.DataSource = this.GetData();
this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
}
private void radButton1_Click(object sender, EventArgs e)
{
dt.Clear();
for (int i = 0; i < 100; i++)
{
dt.Rows.Add(i, "New Name " + i, DateTime.Now.AddDays(i), i % 2 == 0);
}
}
private DataTable GetData()
{
dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Date", typeof(DateTime));
dt.Columns.Add("Bool", typeof(bool));
for (int i = 0; i < 500; i++)
{
dt.Rows.Add(i, "Name " + i, DateTime.Now.AddDays(i), i % 2 == 0);
}
return dt;
}
}
Workaround:
public partial class Form1 : Form
{
DataTable dt;
public Form1()
{
InitializeComponent();
this.radGridView1.DataSource = this.GetData();
this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
this.radGridView1.RowsChanged += RadGridView1_RowsChanged;
}
private void RadGridView1_RowsChanged(object sender, Telerik.WinControls.UI.GridViewCollectionChangedEventArgs e)
{
if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Reset)
{
this.radGridView1.MasterView.PinnedRows.GetType().GetMethod("Clear", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)
.Invoke(this.radGridView1.MasterView.PinnedRows, new object[] { });
}
}
private void radButton1_Click(object sender, EventArgs e)
{
dt.Clear();
for (int i = 0; i < 100; i++)
{
dt.Rows.Add(i, "New Name " + i, DateTime.Now.AddDays(i), i % 2 == 0);
}
}
private DataTable GetData()
{
dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Date", typeof(DateTime));
dt.Columns.Add("Bool", typeof(bool));
for (int i = 0; i < 500; i++)
{
dt.Rows.Add(i, "Name " + i, DateTime.Now.AddDays(i), i % 2 == 0);
}
return dt;
}
}