How to reproduce: just create a grid with a great number of rows e.g. 15000 and scroll down using the page down key
Workaround:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
BaseGridBehavior gridBehavior = radGridView1.GridBehavior as BaseGridBehavior;
gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo));
gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo), new CustomGridDataRowBehavior());
DataTable dataTable = new DataTable();
dataTable.Columns.Add("Id", typeof(int));
dataTable.Columns.Add("Name", typeof(string));
dataTable.Columns.Add("IsValid", typeof(bool));
for (int i = 0; i < 14000; i++)
{
dataTable.Rows.Add(i, "Name " + i, i % 2 == 0 ? true : false);
}
this.radGridView1.DataSource = dataTable;
this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
}
}
public class CustomGridDataRowBehavior : GridDataRowBehavior
{
protected override bool ProcessPageUpKey(KeyEventArgs keys)
{
GridTableElement tableElement = (GridTableElement)this.GridViewElement.CurrentView;
int index = this.GridViewElement.CurrentRow.Index - tableElement.RowsPerPage + 1;
if (index < 0)
{
index = 0;
}
GridViewRowInfo firstScrollableRow = this.GridControl.Rows[index];
this.GridViewElement.CurrentRow = firstScrollableRow;
return true;
}
protected override bool ProcessPageDownKey(KeyEventArgs keys)
{
GridTableElement tableElement = (GridTableElement)this.GridViewElement.CurrentView;
int index = this.GridViewElement.CurrentRow.Index + tableElement.RowsPerPage - 1;
if (index > this.GridControl.Rows.Count - 1)
{
index = this.GridControl.Rows.Count - 1;
}
GridViewRowInfo lastScrollableRow = this.GridControl.Rows[index];
this.GridViewElement.CurrentRow = lastScrollableRow;
return true;
}
}
One should be able to replace the exported file if such exists.
To reproduce:
- Populate the grid with some double values.
- Change the culture to Dutch(Belgian)
- Export the grid
Workaround:
void spreadExporter_CellFormatting(object sender, Telerik.WinControls.UI.Export.SpreadExport.CellFormattingEventArgs e)
{
if (e.GridColumnIndex == 0 && e.GridCellInfo.Value != string.Empty)
{
CellValueFormat cvf = new CellValueFormat("0,00");
e.CellSelection.SetFormat(cvf);
e.CellSelection.SetValue(((double)e.GridCellInfo.Value));
}
}
To reproduce: use the following code snippet and perform the steps illustrated on the attached gif file:
http://www.telerik.com/help/winforms/gridview-filtering-excel-like-filtering.html
public Form1()
{
InitializeComponent();
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Date", typeof(DateTime));
dt.Columns.Add("Name", typeof(string));
DateTime date;
for (int i = 0; i < 5; i++)
{
date = DateTime.Today.AddDays(i);
dt.Rows.Add(i,date, "Item." + i );
date = date.AddHours(2);
dt.Rows.Add(i,date ,"Item." + i + ".2" );
date = date.AddMonths(i);
dt.Rows.Add(i,date, "Item." + i + ".2");
}
this.radGridView1.DataSource = dt;
this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
this.radGridView1.EnableFiltering = true;
this.radGridView1.ShowHeaderCellButtons = true;
((GridViewDateTimeColumn)this.radGridView1.Columns[1]).FilteringMode = GridViewTimeFilteringMode.Date;
this.radGridView1.FilterPopupRequired += radGridView1_FilterPopupRequired;
}
private void radGridView1_FilterPopupRequired(object sender, FilterPopupRequiredEventArgs e)
{
if (e.Column.Name == "Date")
{
e.FilterPopup = new RadListFilterPopup(e.Column, true);
}
}
Workaround:
RadListFilterPopup popup;
private void radGridView1_FilterPopupRequired(object sender, FilterPopupRequiredEventArgs e)
{
if (e.Column.Name == "Date")
{
if (popup == null)
{
popup = new RadListFilterPopup(e.Column, true);
}
e.FilterPopup = popup;
}
}
To reproduce:
private void Form1_Load(object sender, EventArgs e)
{
this.customersTableAdapter.Fill(this.nwindDataSet.Customers);
this.radGridView1.DataSource = this.customersBindingSource;
this.radGridView1.BestFitColumns(Telerik.WinControls.UI.BestFitColumnMode.AllCells);
this.radGridView1.AllowSearchRow = true;
}
Workaround:
private void Form1_Load(object sender, EventArgs e)
{
RadDragDropService svc = this.radGridView1.GridViewElement.GetService<RadDragDropService>();
svc.PreviewDragDrop += svc_PreviewDragDrop;
}
private void svc_PreviewDragDrop(object sender, RadDropEventArgs e)
{
GridViewSearchRowInfo.Cancel = true;
}
To reproduce: - Add two child templates to a grid. - Add summary rows to both of them - Change the value of the child template. Workaround: - Clear and add back the summary rows when a value in the child template is changed.
To reproduce: - Set the cell's BackColor in an entire column. - Set the cell's Forecolor in another column. - Change the grid size to the columns are hidden and then shown again. Workaround: Change similar properties for all the cells where the Style property is used or use CellFormatting.
To reproduce: GridViewMultiComboBoxColumn supplierColumn = new GridViewMultiComboBoxColumn(); supplierColumn.SyncSelectionWithText = true; supplierColumn.Name = "SupplierColumn"; supplierColumn.HeaderText = "Supplier"; supplierColumn.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown; supplierColumn.AutoCompleteMode = AutoCompleteMode.Append; supplierColumn.DataSource = this.suppliersBindingSource; supplierColumn.ValueMember = "SupplierID"; supplierColumn.DisplayMember = "ContactName"; supplierColumn.FieldName = "SupplierID"; supplierColumn.Width = 200; this.radGridView1.Columns.Add(supplierColumn); Select the new row and try to enter some text that is not valid and press Enter. You will notice the new row is added with the last valid auto-completed value. Workaround: cancel the UserAddingRow event if the entered text is not valid.
To reproduce:
- Enter a value in the search row (make sure you will have several results)
- Enter a letter in the filtering row. The filetring row will lose the focus.
Workaround:
public class MyGridViewSearchRowInfo : GridViewSearchRowInfo
{
public MyGridViewSearchRowInfo(GridViewInfo viewInfo) : base(viewInfo)
{
}
public override void SelectNextSearchResult()
{
GridViewSystemRowInfo systemRow = this.ViewTemplate.MasterTemplate.CurrentRow as GridViewSystemRowInfo;
if (systemRow != null && this.ViewTemplate.MasterTemplate.Owner.EditorManager.IsInEditMode)
{
return;
}
base.SelectNextSearchResult();
}
}
//change the default row like this
void radGridView1_CreateRowInfo(object sender, GridViewCreateRowInfoEventArgs e)
{
if (e.RowInfo is GridViewSearchRowInfo)
{
e.RowInfo = new MyGridViewSearchRowInfo(e.ViewInfo);
}
}
To reproduce: - Add grid with several columns and set their AllowResize property to false. - Set the FitWidthMode to FitPageWidth. - Print the grid and you will notice that some of the columns are cut off. Workaround: - Set the AllowResize property to true before printing.
To reproduce : - Set conditional formatting for all grid cells. - Iterate all grid cells and set their value. Workaround: Use Begin/End update block.
Please refer to the attached screenshot. Workaround: either select the RadGridView node in the Property Builder, or use the VS design time or control Smart Tag to set DataSource
To reproduce:
Me.RadGridView1.MultiSelect = True
Private Sub RadGridView1_CellFormatting(sender As Object, e As Telerik.WinControls.UI.CellFormattingEventArgs) _
Handles RadGridView1.CellFormatting
If e.Row.IsSelected Then
e.CellElement.BackColor = Color.LimeGreen
e.CellElement.DrawFill = True
e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
Else
e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local)
e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local)
e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local)
End If
End Sub
Step 1: Select a few rows with the mouse click in combination with the CTRL key.
Step 2: The rows are selected correctly and the desired green back color is applied. Release the CTRL Key.
Step 3: Click with the mouse on a different row in the grid.
Result: All previously selected rows but the last current row keep the green back color.
Workaround:
Sub New()
InitializeComponent()
Me.RadGridView1.MultiSelect = True
AddHandler Me.RadGridView1.SelectionChanging, AddressOf SelectionChanging
AddHandler Me.RadGridView1.SelectionChanged, AddressOf SelectionChanged
End Sub
Private Sub RadGridView1_CellFormatting(sender As Object, e As Telerik.WinControls.UI.CellFormattingEventArgs) _
Handles RadGridView1.CellFormatting
e.CellElement.DrawFill = True
e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
If e.Row.IsSelected Then
e.CellElement.BackColor = Color.LimeGreen
Else
e.CellElement.BackColor = Color.Yellow
End If
End Sub
Private Sub SelectionChanged(sender As Object, e As EventArgs)
For Each r As GridViewRowInfo In selectedRows
r.InvalidateRow()
Next
selectedRows.Clear()
End Sub
Dim selectedRows As New List(Of GridViewRowInfo)
Private Sub SelectionChanging(sender As Object, e As GridViewSelectionCancelEventArgs)
For Each r As GridViewRowInfo In Me.RadGridView1.SelectedRows
selectedRows.Add(r)
Next
End Sub
To reproduce:
private RadGridView radGridView1;
public Form1()
{
InitializeComponent();
radGridView1 = new RadGridView() { Dock = DockStyle.Fill };
Controls.Add(radGridView1);
List<Item> items = new List<Item>();
for (int i = 0; i < 10; i++)
{
items.Add(new Item(i, "Item" + i, DateTime.Now.AddDays(i)));
}
radGridView1.AutoGenerateColumns = true;
this.radGridView1.DataSource = items;
this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
this.radGridView1.EnableFiltering = true;
this.radGridView1.CustomFiltering += radGridView1_CustomFiltering;
radGridView1.EnableCustomFiltering = true;
}
void radGridView1_CustomFiltering(object sender, GridViewCustomFilteringEventArgs e)
{
e.Handled = false;
e.Visible = true;
var item = (Item)e.Row.DataBoundItem;
if (item == null)
return;
if (item.Name.EndsWith("Item"))
{
e.Handled = true;
e.Visible = false;
}
}
public class Item
{
public int Id { get; set; }
public string Name { get; set; }
public Nullable<DateTime> Date { get; set; }
public Item(int id, string name, Nullable<DateTime> date)
{
this.Id = id;
this.Name = name;
this.Date = date;
}
}
Workaround:
private void radGridView1_CellEndEdit(object sender, GridViewCellEventArgs e)
{
this.radGridView1.MasterTemplate.Refresh();
}
Workaround: set up the templates from code, http://www.telerik.com/help/winforms/gridview-overview.html
Use the following help article to set up the hierarchy >> http://www.telerik.com/help/winforms/gridview-hierarchical-grid-self-referencing-hierarchy.html Please refer to the attached gif files illustrating the behavior in Q1 SP and Q2.