Workaround: set the theme with ThemeResolutionService.ApplicationThemeName = "MyThemeName
Note: if you try to clear the initial minimum value by pressing Backspace or Delete key, the editor value reappears.
To reproduce:
GridViewDecimalColumn decimalColumn2 = new GridViewDecimalColumn("Col2");
decimalColumn2.FieldName = "Number";
decimalColumn2.Minimum = -50;
decimalColumn2.Maximum = 50;
radGridView2.MasterTemplate.Columns.Add(decimalColumn2);
radGridView2.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
radGridView2.EnableFiltering = true;
Workaround:
private void radGridView2_EditorRequired(object sender, Telerik.WinControls.UI.EditorRequiredEventArgs e)
{
if (e.EditorType == typeof(GridSpinEditor))
{
e.EditorType = typeof(CustomEditor);
}
}
public class CustomEditor : GridSpinEditor
{
protected override Telerik.WinControls.RadElement CreateEditorElement()
{
return new CustomElement();
}
}
public class CustomElement : GridSpinEditorElement
{
protected override decimal GetValueFromText()
{
if (string.IsNullOrEmpty(this.Text))
{
return this.MinValue;
}
return base.GetValueFromText();
}
}
To reproduce:
1. Add a GridViewDecimalColumn to a grid with data type int, float, decimal, double, real, money.
2. Add few rows where one of rows contains null value.
3. Run the form. Sort the grid by any of column with null data and you will see that the exception is thrown.
Workaround:
1. Use custom TypeConverter
public class CustomFloatConverter : TypeConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(float);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(float) && (value == null || value is DBNull))
{
return float.MinValue;
}
return value;
}
}
public class CustomIntConverter : TypeConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(int);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(int) && (value == null || value is DBNull))
{
return int.MinValue;
}
return value;
}
}
public class CustomDecimalConverter : TypeConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(decimal);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(decimal) && (value == null || value is DBNull))
{
return decimal.MinValue;
}
return value;
}
}
public class CustomDoubleConverter : TypeConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(double);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(double) && (value == null || value is DBNull))
{
return double.MinValue;
}
return value;
}
}
public class CustomSingleConverter : TypeConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
return destinationType == typeof(Single);
}
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(Single) && (value == null || value is DBNull))
{
return Single.MinValue;
}
return value;
}
}
2. Apply the converter to GridViewDecimalColumn
this.radGridView2.Columns["ColumnReal"].DataTypeConverter = new CustomSingleConverter();
this.radGridView2.Columns["ColumnFloat"].DataTypeConverter = new CustomDoubleConverter();
this.radGridView2.Columns["ColumnDecimal"].DataTypeConverter = new CustomDecimalConverter();
this.radGridView2.Columns["ColumnInt"].DataTypeConverter = new CustomIntConverter();
this.radGridView2.Columns["ColumnNumeric"].DataTypeConverter = new CustomDecimalConverter();
this.radGridView2.Columns["ColumnMoney"].DataTypeConverter = new CustomDecimalConverter();
There should be a Enum (Left, Right, None) property of the Expander Column indicating whether the position of the expander column should be left right or none. This would be especially important during pinning activities meaning no matter how many columns are being pinned and repositioned in the pinned area of the grid, it would always remain on the left, right or none.
Steps to reproduce:
1. Add a GridViewDateTimeColumn to a grid.
2. Add rows where one or more rows should contain null as the columns value.
3. Sort the grid by the date time column.
WORKAROUND:
Create a custom RadGridDateTimeConverter and assign it as the column's date type converter:
public class CustomRadGridDateTimeConverter : RadGridDateTimeConverter
{
public CustomRadGridDateTimeConverter(GridViewDateTimeColumn column)
: base(column)
{ }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(DateTime) && value == null)
{
return DateTime.MinValue;
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
this.radGridView1.Columns["DateTime"].DataTypeConverter = new CustomRadGridDateTimeConverter(this.radGridView1.Columns["DateTime"] as GridViewDateTimeColumn);
To reproduce: Download the attached files. One contains a project with TelerikDataAccess, the other one contains the SQL script to create the database. Before starting the project notice the column with header text "column1". You will see that its expression is as follows: "Player.Person.FirstName+\",\"+Player.Person.LastName". Starting the project at this point will not produce an exception. Change the name of the column to FirstName and start the project, you will see the stack overflow exception.
The horizontal scrollbar of the control does not behave correctly when there are several pinned columns and their width is larger than the visible area of RadGridView.
The RadGridView should not leave its edit mode state, when scrolling is performed.
Workaround: set the data type of the column to null before saving the layout and after loading it set it with the needed type
RadGridView scrolls to the top when copy and paste operations are performed.
The grid scrolls to left when there are a lot of columns as well.
In addition this is only observed when the cell is not in edit mode.
Workaround:
public class MyGridBehavior : BaseGridBehavior
{
public override bool ProcessKey(KeyEventArgs keys)
{
bool isPaste = false;
if (keys.Control && keys.KeyCode == Keys.V && this.GridViewElement.Template.ClipboardCopyMode != GridViewClipboardCopyMode.Disable)
{
if (!(this.GridViewElement.Template.GridReadOnly || this.GridViewElement.Template.ReadOnly))
{
isPaste = true;
}
}
GridTableElement currentTableElement = this.GridViewElement.CurrentView as GridTableElement;
int vScroll = currentTableElement.VScrollBar.Value;
int hScroll = currentTableElement.HScrollBar.Value;
bool result = base.ProcessKey(keys);
if (isPaste)
{
currentTableElement.VScrollBar.Value = vScroll;
currentTableElement.HScrollBar.Value = hScroll;
}
return result;
}
}
this.radGridView1.GridBehavior = new MyGridBehavior();
Horizontal cell navigation causes sometime scrolling per page instead of paging to the next invisible column.
RadGridView - the Row property in the event arguments of the RowValidating event is null when the user deletes a row. Also the Column property in the event arguments of the CellValidating event is null when the user deletes a row.
When add dg.Relations.AddSelfReference(dg.MasterTemplate,"ID", "IDPARENT"); The event bnds_PositionChanged works only when go with level on another. А within the one level does not work. Operation of the removing does not work too. Also is not working properly displaying alternative rows. EnableAlternatingRowColor=true;
If you have a scenario which involves localization and you have columns with empty strings, these empty string values are serialized in the localization files.
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.
The new rows is added in ChildViewExpanded event
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.
Two sequential rows can have the same background in the case of enabled alternating row color functionality. This is an issue when self-reference hierarchy is used and the two rows are not at the same hierarchy level.
You cannot select cells from first and last column when the RadGridView is in right to left mode.