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.
Workaround:
public Form1()
{
InitializeComponent();
this.radGridView1.CreateCell += radGridView1_CreateCell;
GridViewCheckBoxColumn checkBoxColumn = new GridViewCheckBoxColumn("CheckBoxColumn");
checkBoxColumn.EnableHeaderCheckBox = false;
checkBoxColumn.ThreeState = true;
checkBoxColumn.EditMode = EditMode.OnValueChange;
radGridView1.MasterTemplate.Columns.Add(checkBoxColumn);
radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
for (int i = 0; i < 20; i++)
{
this.radGridView1.Rows.Add(false);
}
}
private void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
if (e.CellType == typeof(GridCheckBoxHeaderCellElement))
{
CustomGridCheckBoxHeaderCellElement headerCell = new CustomGridCheckBoxHeaderCellElement(e.Column, e.Row);
e.CellElement = headerCell;
}
}
public class CustomGridCheckBoxHeaderCellElement : GridHeaderCellElement
{
public CustomGridCheckBoxHeaderCellElement(GridViewColumn column, GridRowElement row) : base(column, row)
{
}
protected override Type ThemeEffectiveType
{
get
{
return typeof(GridHeaderCellElement);
}
}
RadCheckBoxElement cb = new RadCheckBoxElement();
protected override void CreateChildElements()
{
base.CreateChildElements();
this.Children.Add(cb);
cb.IsThreeState = true;
cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off;
cb.ToggleStateChanged += CheckBox_ToggleStateChanged;
}
bool boolValue = false;
public override void SetContent()
{
base.SetContent();
if (!flag)
{
bool atLeastOneTrue = false;
bool atLeastOneFalse = false;
foreach (GridViewRowInfo r in this.GridViewElement.Template.Rows)
{
if (r.Cells[0].Value != null)
{
if (atLeastOneTrue && atLeastOneFalse)
{
break;
}
boolValue = (bool)r.Cells[0].Value;
if (boolValue)
{
atLeastOneTrue = true;
}
else
{
atLeastOneFalse = true;
}
}
else
{
atLeastOneFalse = true;
}
}
if (atLeastOneFalse && atLeastOneTrue)
{
cb.ToggleStateChanged -= CheckBox_ToggleStateChanged;
cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Indeterminate;
cb.ToggleStateChanged += CheckBox_ToggleStateChanged;
}
else if (atLeastOneFalse == true)
{
cb.ToggleStateChanged -= CheckBox_ToggleStateChanged;
cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off;
cb.ToggleStateChanged += CheckBox_ToggleStateChanged;
}
else if (atLeastOneTrue == true)
{
cb.ToggleStateChanged -= CheckBox_ToggleStateChanged;
cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
cb.ToggleStateChanged += CheckBox_ToggleStateChanged;
}
}
}
bool flag = false;
private void CheckBox_ToggleStateChanged(object sender, StateChangedEventArgs args)
{
cb.ToggleStateChanged -= CheckBox_ToggleStateChanged;
flag = true;
if (args.ToggleState == Telerik.WinControls.Enumerations.ToggleState.Indeterminate)
{
cb.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off;
}
ToggleStateForChildRows(args.ToggleState, this.GridControl);
flag = false;
cb.ToggleStateChanged += CheckBox_ToggleStateChanged;
}
private void ToggleStateForChildRows(Telerik.WinControls.Enumerations.ToggleState toggleState, RadGridView radGridView)
{
foreach (GridViewRowInfo r in radGridView.Rows)
{
r.Cells[0].Value = toggleState == Telerik.WinControls.Enumerations.ToggleState.On;
}
}
}
1. Use the following code snippet:
public Form1()
{
InitializeComponent();
this.radGridView1.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
this.radGridView1.MasterTemplate.EnableAlternatingRowColor = true;
this.radGridView1.MasterTemplate.EnableFiltering = true;
this.radGridView1.MasterTemplate.MultiSelect = true;
for (int i = 0; i < 3; i++)
{
this.radGridView1.Columns.Add("Col"+i);
}
radGridView1.Rows.Add("test1", "test1", "test1");
radGridView1.Rows.Add("test2", "test2", "test2");
radGridView1.Rows.Add("test3", "test3", "test3");
radGridView1.Rows.Add("test4", "test4", "test4");
radGridView1.Rows.Add("test5", "test5", "test5");
}
2. Quickly click around the cells a few times, making sure to drag your mouse a bit to select a few rows on some of the clicks.
Then quickly click the filter. (sometimes it takes a few tries)
Workaround: use custom GridFilterRowBehavior
BaseGridBehavior gridBehavior = radGridView1.GridBehavior as BaseGridBehavior;
gridBehavior.UnregisterBehavior(typeof(GridViewFilteringRowInfo));
gridBehavior.RegisterBehavior(typeof(GridViewFilteringRowInfo), new CustomGridFilterRowBehavior());
public class CustomGridFilterRowBehavior : GridFilterRowBehavior
{
protected override bool ProcessMouseSelection(Point mousePosition, GridCellElement currentCell)
{
return false;
}
}
To reproduce:
- Add GridViewDateTimeColumn.
- Set the editor properties:
private void radGridView_VehicleAbsenceTime_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
RadDateTimeEditor lEditor = radGridView_VehicleAbsenceTime.ActiveEditor as RadDateTimeEditor;
if (lEditor != null)
{
RadDateTimeEditorElement editorElement = (RadDateTimeEditorElement)lEditor.EditorElement;
editorElement.Format = DateTimePickerFormat.Custom;
editorElement.CustomFormat = "dd.MM.yyyy HH:mm";
editorElement.ShowUpDown = true;
}
}
- Start the application scroll to the bottom and start editing.
To reproduce: GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1); spreadExporter.RunExport(@"C:\exportedFile.xlsx"); Workaround: GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1); spreadExporter.RunExport(@"C:\exportedFile.xlsx", new SpreadExportRenderer()); Alternatively you can set the Copy Local property of the TelerikExport assembly to true.
Workaround: set the theme with ThemeResolutionService.ApplicationThemeName = "MyThemeName