Use attached to reproduce.
Workaround:
private void RadGridView1_ColumnChooserCreated(object sender, Telerik.WinControls.UI.ColumnChooserCreatedEventArgs e)
{
var columnChooser = e.ColumnChooser as GridViewColumnChooser;
columnChooser.Shown -= ColumnChooser_Shown;
columnChooser.Shown += ColumnChooser_Shown;
}
private void ColumnChooser_Shown(object sender, EventArgs e)
{
var columnChooser = sender as GridViewColumnChooser;
var factor = this.FormElement.DpiScaleFactor;
columnChooser.Scale(factor);
}
To reproduce: please refer to the attached sample gif file. Note that it is important that the child template is bound at design time and the columns are automatically generated. Workaround: setup the ViewDefinition programmatically:
Use attached to reproduce.
- Use a 125% and 150% monitor for reproducing.
- This should be tested on Windows 10 1803 (Spring Update) as well.
Workaround:
private void RadGridView1_ColumnChooserCreated(object sender, Telerik.WinControls.UI.ColumnChooserCreatedEventArgs e)
{
e.ColumnChooser = new MyColumnChooser(this.radGridView1.MasterTemplate, radGridView1.GridViewElement);
}
public partial class MyColumnChooser : GridViewColumnChooser
{
public MyColumnChooser()
{
InitializeComponent();
}
public MyColumnChooser(GridViewTemplate template, RadGridViewElement rootElement) : base(template, rootElement)
{
}
SizeF oldDpi = new SizeF(1, 1);
protected override void HandleDpiChanged()
{
base.HandleDpiChanged();
SizeF descale = new SizeF(1f / this.FormElement.DpiScaleFactor.Width, 1f / this.FormElement.DpiScaleFactor.Height);
this.Scale(descale);
var dpi = NativeMethods.GetMonitorDpi(Screen.FromRectangle(this.Bounds), NativeMethods.DpiType.Effective);
if (oldDpi != dpi)
{
SizeF sz = new SizeF(dpi.Width / oldDpi.Width, dpi.Height / oldDpi.Height);
this.Scale(dpi);
}
oldDpi = dpi;
}
}
To reproduce: please refer to the attached gif file illustrating the steps how to reproduce the problem with the Demo application.
Workaround:
private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
GridDataCellElement cell = e.CellElement as GridDataCellElement;
if (cell != null)
{
if (cell.ContainsErrors)
{
cell.DrawBorder = true;
cell.BorderBoxStyle = BorderBoxStyle.FourBorders;
cell.BorderBottomColor = cell.BorderTopColor = cell.BorderRightShadowColor = cell.BorderLeftShadowColor = Color.Transparent;
cell.BorderBottomShadowColor = cell.BorderTopShadowColor = cell.BorderRightColor = cell.BorderLeftColor = Color.Red;
cell.BorderBottomWidth = cell.BorderTopWidth = cell.BorderRightWidth = cell.BorderLeftWidth = 1;
cell.BorderDrawMode = BorderDrawModes.HorizontalOverVertical;
cell.ZIndex = 2;
}
else
{
cell.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderBoxStyleProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderBottomColorProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderBottomShadowColorProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderBottomWidthProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderTopColorProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderTopShadowColorProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderTopWidthProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderLeftColorProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderLeftShadowColorProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderLeftWidthProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.BorderDrawModeProperty, ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.ZIndexProperty, ValueResetFlags.Local);
}
}
}
Hello, Please create a GridViewDateTimeOffsetColumn to support DateTimeOffset type. A datetimeoffset editor would be good and support of nullable date types. Thank you!
How to reproduce: check the attached project and comment the workaround
Workaround:
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
private BindingList<TestDataObject> data;
public RadForm1()
{
InitializeComponent();
this.data = new BindingList<TestDataObject>();
this.LoadData();
GridViewTextBoxColumn textColumn = new GridViewTextBoxColumn();
textColumn.Name = "Name";
textColumn.FieldName = "Name";
textColumn.HeaderText = "Name";
this.radGridView1.Columns.Add(textColumn);
GridViewDateTimeColumn dateColumn = new GridViewDateTimeColumn();
dateColumn.Name = "Date";
dateColumn.FieldName = "Date";
dateColumn.HeaderText = "Date";
this.radGridView1.Columns.Add(dateColumn);
GridViewMaskBoxColumn maskBoxColumn = new GridViewMaskBoxColumn();
maskBoxColumn.Name = "Price";
maskBoxColumn.FieldName = "Price";
maskBoxColumn.HeaderText = "Price";
maskBoxColumn.MaskType = MaskType.Numeric;
maskBoxColumn.Mask = "C";
maskBoxColumn.TextAlignment = ContentAlignment.BottomRight;
maskBoxColumn.FormatString = "{0:C}";
maskBoxColumn.DataType = typeof(decimal);
this.radGridView1.Columns.Add(maskBoxColumn);
this.radGridView1.DataSource = this.data;
this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
//Workaround
this.radGridView1.CellBeginEdit += RadGridView1_CellBeginEdit;
this.radGridView1.EditorRequired += RadGridView1_EditorRequired;
}
void RadGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
{
if (e.EditorType == typeof(RadMaskedEditBoxEditor))
{
e.EditorType = typeof(MyRadMaskedEditBoxEditor);
}
}
private void RadGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
RadMaskedEditBoxEditor maskedEditBoxEditor = e.ActiveEditor as RadMaskedEditBoxEditor;
if (maskedEditBoxEditor != null && e.Row.Cells[e.ColumnIndex].Value == null)
{
maskedEditBoxEditor.MaskTextBox.EnableNullValueInput = true;
}
else
{
maskedEditBoxEditor.MaskTextBox.EnableNullValueInput = false;
}
}
private void LoadData()
{
for (int i = 0; i < 1000; i++)
{
decimal? price = null;
if (i % 2 == 0)
{
price = i * 100;
}
this.data.Add(new TestDataObject
{
Name = "Name " + i,
Date = DateTime.Now.AddDays(i),
Price = price
});
}
}
}
public class TestDataObject
{
public string Name { get; set; }
public DateTime Date { get; set; }
public decimal? Price { get; set; }
}
public class MyRadMaskedEditBoxEditor : RadMaskedEditBoxEditor
{
public override object Value
{
get
{
return base.Value;
}
set
{
if (value == null && (this.MaskTextBox.EnableNullValueInput || this.MaskTextBox.MaskType != MaskType.Numeric))
{
this.MaskTextBox.Value = this.NullValue;
}
else
{
base.Value = value;
}
}
}
}
Hi, We got an issue comparable to the one already described (see 245938), using the same demo project 1) I add LastDeliveryDateTimeLocal column 2) remove groups 3) click on "Start async notifications" 4) click on the filter icon next to "LastDeliveryDateTimeLocal" column name 5) uncheck some values (08/09/2016, 11/11/2016, 03/01/2017) 6) click Ok => NullReferenceException
Hi, Following to the workaroud (flag IsSearchAsync) provided (https://feedback.telerik.com/Project/154/Feedback/Details/245938-fix-radgridview-having-groups-filters-sort-descriptors-and-search-query-in-t), we discovered two issues : 1) the behavior of the grid is changed while using IsSearchAsync as true or false (see 2018-08-01_1849_DragDrop_behavior_with_IsSearchAsync.swf video attached). When set to true, the line found by the searchbox is automatically reselected. When the flag is set to false, it's not the case. 2) while playing with drag&drop, after some time the grid became unstable (see 2018-08-01_1847_-_dragdrop_issue_with_IsAsyncSearch.swf video attached). You can see that at the beginning, the D&D works fine. At 0:20 I can't select any line, and when I try to D&D, it drops always the same customer. At 0:40 you can see that even the SearchBox is broken and the progressbar is looping forever
Add a new property AllowSelection/EnableSelection in order to control whether the use can select a cell/row.
Workaround:
Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.ProductsTableAdapter.Fill(Me.NwindDataSet.Products)
Me.RadGridView1.CurrentRow = Nothing
AddHandler Me.RadGridView1.SelectionChanging, AddressOf Grid_SelectionChanging
AddHandler Me.RadGridView1.CurrentRowChanging, AddressOf Grid_CurrentRowChanging
End Sub
Private Sub Grid_SelectionChanging(sender As Object, e As Telerik.WinControls.UI.GridViewSelectionCancelEventArgs)
e.Cancel = True
End Sub
Private Sub Grid_CurrentRowChanging(sender As Object, e As Telerik.WinControls.UI.CurrentRowChangingEventArgs)
e.Cancel = True
End Sub
To reproduce:
private void radButton1_Click(object sender, EventArgs e)
{
RadPrintDocument printDocument = new RadPrintDocument();
printDocument.DefaultPageSettings.Landscape = true;
printDocument.DocumentName = "Example Case";
GridPrintStyle style = new GridPrintStyle(this.radGridView1)
{
FitWidthMode = PrintFitWidthMode.FitPageWidth,
PrintGrouping = false,
PrintSummaries = false,
PrintHeaderOnEachPage = true,
PrintHiddenColumns = false,
};
TableViewDefinitionPrintRenderer renderer = new TableViewDefinitionPrintRenderer(this.radGridView1);
renderer.PrintPages.Add(
this.radGridView1.Columns[1],
this.radGridView1.Columns[2],
this.radGridView1.Columns[3],
this.radGridView1.Columns[4],
this.radGridView1.Columns[5],
this.radGridView1.Columns[6]);
style.PrintRenderer = renderer;
this.radGridView1.PrintStyle = style;
this.radGridView1.PrintCellFormatting += RadGridView1_PrintCellFormatting;
radGridView1.Print(true, printDocument);
}
private void RadGridView1_PrintCellFormatting(object sender, Telerik.WinControls.UI.PrintCellFormattingEventArgs e)
{
}
Workaround: use the PrintCellFormatting of the TableViewDefinitionPrintRenderer
To reproduce: run the sample approach an follow the steps: 1. Filter the "Mask" column by entering " " in the filter cell. Press Enter. The grid is filtered as expected. 2. Activate the editor again and press Backspace+Enter. You will notice that it is not possible to clear the applied filter. Workaround: use GridViewTextBoxColumn
Use attached to reproduce.
- Open the data filter dialog from the excel-like filtering on the date column.
- The date time format in the editor is not respected.
- Consider the default cell editor as well.
Workaround:
private void RadGridView1_CreateCompositeFilterDialog(object sender, GridViewCreateCompositeFilterDialogEventArgs e)
{
var dialog = e.Dialog as CompositeDataFilterForm;
dialog.DataFilter.EditorInitialized -= DataFilter_EditorInitialized;
dialog.DataFilter.EditorInitialized += DataFilter_EditorInitialized;
dialog.DataFilter.NodeFormatting -= DataFilter_NodeFormatting;
dialog.DataFilter.NodeFormatting += DataFilter_NodeFormatting;
}
private void DataFilter_NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
{
var criteriaNode = e.NodeElement as DataFilterCriteriaElement;
if (criteriaNode != null)
{
var node = criteriaNode.Data as DataFilterCriteriaNode;
if (node.DescriptorValue != null && node.PropertyName == "Date")
{
criteriaNode.ValueElement.Text = ((DateTime?)node.DescriptorValue).Value.ToString("MM/dd/yyyy");
}
}
}
private void DataFilter_EditorInitialized(object sender, TreeNodeEditorInitializedEventArgs e)
{
var editor = e.Editor as TreeViewDateTimeEditor;
if (editor != null)
{
var element = editor.EditorElement as BaseDateTimeEditorElement;
element.Format = DateTimePickerFormat.Custom;
element.CustomFormat = "dd/MM/yyyy";
}
}
To reproduce: add a RadGridView with several columns. Set the Enabled property to false. Try to open the Property Builder and you will notice that the Columns are disabled in it. Workaround: set the Enabled property to false at run time. Thus, it would be possible to manipulate the columns via the Property Builder at design time.
To reproduce: run the attached sample project and activate the editor for the cell. You will notice that the row's height is now adjusted and single line text is displayed. It seems that the issue occurs because of the set Font property of the grid.
Workaround:
private void RadGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
e.Row.MinHeight = e.Row.Height + 3;
RadTextBoxEditor tbEditor = e.ActiveEditor as RadTextBoxEditor;
if (tbEditor != null)
{
tbEditor.Multiline = true;
}
}
private void radGridView1_CellEndEdit(object sender, GridViewCellEventArgs e)
{
e.Row.MinHeight = 0;
}
Use attached to reproduce.
Workaround:
private void RadGridView1_UserAddingRow(object sender, GridViewRowCancelEventArgs e)
{
e.Cancel = true;
}
To reproduce: - Set IsSearchAsync to false. - Search for something and press down arrow to navigate to the last found item. - Press down again the selection is not moved to the first item.
To reproduce: please refer to the attached screenshot
public RadForm1()
{
InitializeComponent();
ThemeResolutionService.ApplicationThemeName = "Fluent";
this.BackColor = Color.White;
this.radGridView1.EnableGrouping = false;
}
Workaround: this.radGridView1.TableElement.Margin = new Padding(0, 1, 0, 0);
To reproduce: - Add a checkbox column and hide some of the cells. - Change some values and then click on empty cell. - Exception occurs in OnMouseDownLeft method (GridRowBeahvior class) Workaround: Hide the checkbox only.
To reproduce: change the decimal separator to ",".
Please refer to the attached sample project and follow the steps from the attached gif file.
Workaround: change the CurrentCulture in your application in order to affect the decimal separator:
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");