To reproduce: - add couple columns in design time - populate them in the form's constructor - subscribe to the cell formatting event where validation will be performed The result is that the indent cell hover displays the error text set and the data cells are formatted correctly, but the exclamation mark is not displayed until the grid is scrolled. It seems that the indent cell is not invalidated WORKAROUND: Call the Refresh method of the template
STEPS TO REPRODUCE:
1) Create an excel file with sample string values (for example 3x3):
| Value 1 | Value 2 | Value 3 |
| Value 4 | Value 5 | Value 6 |
| Value 7 | Value 8 | Value 9 |
2) Validate as double:
private ErrorProvider errorProvider = new ErrorProvider();
void gridView_CellValidated(object sender, CellValidatedEventArgs e)
{
if (e.Value == null)
{
return;
}
var cell = e.Row.Cells[e.ColumnIndex];
double value = 0;
if (double.TryParse(e.Value.ToString(), out value))
{
cell.ErrorText = string.Empty;
errorProvider.SetError(gridView, string.Empty);
}
else
{
cell.ErrorText = "Wrong input format";
errorProvider.SetError(gridView, "Wrong input format");
}
}
3) Copy the cells from excel and paste them in the grid
Expected result: Validate all cells
Actual result: Only the current cell is being validated and the CellValidated and CellValidating events are not fired for the other cells
WORKAROUND:
public class CustomGridBehavior : BaseGridBehavior
{
Form1 form;
public CustomGridBehavior(Form1 form)
{
this.form = form;
}
public override bool ProcessKey(KeyEventArgs keys)
{
if (keys.KeyCode == Keys.V && keys.Control)
{
GridControl.MasterTemplate.Paste();
foreach (GridViewRowInfo row in GridControl.ChildRows)
{
form.ValidateCell(row.Cells[GridControl.CurrentColumn.Index]);
}
return true;
}
return base.ProcessKey(keys);
}
}
void gridView_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
foreach (RadMenuItem item in e.ContextMenu.Items)
{
if (item.Text == "Paste")
{
e.ContextMenu.Items.Remove(item);
break;
}
}
RadMenuItem myPasteItem = new RadMenuItem("Paste");
myPasteItem.Click += new EventHandler(myPasteItem_Click);
e.ContextMenu.Items.Add(myPasteItem);
}
void myPasteItem_Click(object sender, EventArgs e)
{
gridView.MasterTemplate.Paste();
foreach (GridViewRowInfo row in gridView.ChildRows)
{
ValidateCell(row.Cells[gridView.CurrentColumn.Index]);
}
}
The DataType property is not implemented in the designer. Currently you could set this property only by code.
When a mask is set to a GridViewMaskBoxColumn and string is applied as value, the visual element will show only the string without the mask literals. E.g. mask is set to ####/# and value is set to string "11112" the view will be 11112 instead of 1111/2. Ways to achieve this: 1. Use CellFormatting. 2. Use a custom type converter: Example of a custom TypeConverter could be seen from the following feedback item: http://feedback.telerik.com/Project/154/Feedback/Details/112463-fix-radgridview-the-textmaskformat-property-of-gridviewmaskboxcolumn-is-not-ta
In RadGridView with a TextBoxColumn.
Set WrapText, Multiline and AcceptsReturn to true
If adding a new line, the return gives another new line instead of staying within the cell.
Workaround:
Create a new behavior class:
//VB
Class MyNewRowBehavior
Inherits GridNewRowBehavior
Protected Overrides Function ProcessEnterKey(keys As KeyEventArgs) As Boolean
If Me.GridControl.IsInEditMode AndAlso Me.GridControl.CurrentColumn.Name = "TextBoxColumn" Then
Dim editor As RadTextBoxEditor = TryCast(Me.GridControl.ActiveEditor, RadTextBoxEditor)
Dim element As RadTextBoxEditorElement = DirectCast(editor.EditorElement, RadTextBoxEditorElement)
element.Text.Insert(element.Text.Length, Environment.NewLine)
Return True
Else
Return MyBase.ProcessEnterKey(keys)
End If
End Function
End Class
//C#
class MyNewRowBehavior : GridNewRowBehavior
{
protected override bool ProcessEnterKey(KeyEventArgs keys)
{
if (this.GridControl.IsInEditMode && this.GridControl.CurrentColumn.Name == "TextBoxColumn")
{
RadTextBoxEditor editor = this.GridControl.ActiveEditor as RadTextBoxEditor;
RadTextBoxEditorElement element = (RadTextBoxEditorElement)editor.EditorElement;
element.Text.Insert(element.Text.Length, Environment.NewLine);
return true;
}
else
{
return base.ProcessEnterKey(keys);
}
}
}
then unregister the old behavior and register the new one:
//VB
DirectCast(radGridView1.GridBehavior, BaseGridBehavior).UnregisterBehavior(GetType(GridViewNewRowInfo))
DirectCast(radGridView1.GridBehavior, BaseGridBehavior).RegisterBehavior(GetType(GridViewNewRowInfo), New MyNewRowBehavior())
//C#
((BaseGridBehavior)radGridView1.GridBehavior).UnregisterBehavior(typeof(GridViewNewRowInfo));
((BaseGridBehavior)radGridView1.GridBehavior).RegisterBehavior(typeof(GridViewNewRowInfo), new MyNewRowBehavior());
To reproduce:
-set AutoSizeMode to Fill
- Add view definition with two rows
- Add check box column to the view
-Set check box column minWidth
Workaround:
Create a custom view definition, then create a custom ColumnGroupRowLayout class and override the GetClumnWidth method like this:
class MyViewDefinition : ColumnGroupsViewDefinition
{
public MyViewDefinition()
{
}
public override IGridRowLayout CreateRowLayout()
{
return new MyRowLayout(this);
}
}
public class MyRowLayout : ColumnGroupRowLayout
{
public MyRowLayout(ColumnGroupsViewDefinition view):base(view)
{
}
public override int GetColumnWidth(GridViewColumn column)
{
return Math.Max( base.GetColumnWidth(column), column.MinWidth);
}
}
To Reproduce:
- Add GridViewCalculatorColumn to a RadGridView.
- When you begin edit a cell the value is not selected.
Workaround:
Create a custom RadCalculatorEditor and then change the editor in EditorRequired event:
void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
{
if (e.EditorType.Name == "RadCalculatorEditor")
{
e.Editor = new CustomCalculatorEditor();
}
}
public class CustomCalculatorEditor : RadCalculatorEditor
{
public override void BeginEdit()
{
base.BeginEdit();
RadCalculatorDropDownElement editorElement = this.EditorElement as RadCalculatorDropDownElement;
editorElement.EditorContentElement.TextBoxItem.SelectAll();
}
}
To reproduce: - Add MultiColumnComboBoxColumn to a blank grid. - Subscribe to the SelectedIndexChanged event of the corresponding ActiveEditor (RadMultiColumnComboBoxElement). - You will notice that when you select different cells the event is fired several times.
To reproduce: - Subscribe to the grids KeyDown event. - You will notice that KeyDown event is not fired when the control key is pressed. Workaround: - Use the KeyUp event instead. - Also setting the ClipboardCopyMode property to disabled will activate the event for this case.
Add the ability to access the ColumnChooser opening in order to set its properties. Currently, every time when the user opens the ColumnChoser new instance is created and because of this its properties and events are no longer available. This feature will
Resolution:
Add the ColumnChooserCreated event which access and allow to customize the ColumnChooser.
//subscribe to the event ColumnChooserCreated
this.radGridView1.ColumnChooserCreated += new ColumnChooserCreatedEventHandler(radGridView1_ColumnChooserCreated);
//customize the ColumnChooser
void radGridView1_ColumnChooserCreated(object sender, Telerik.WinControls.UI.ColumnChooserCreatedEventArgs e)
{
e.ColumnChooser.ForeColor = Color.DarkGreen;
e.ColumnChooser.Text = "My title";
e.ColumnChooser.ColumnChooserControl.ColumnChooserElement.Font = this.Font;
e.ColumnChooser.ColumnChooserControl.ColumnChooserElement.Text = "My text";
}
To reproduce: Create a RadGridView and set its view to ColumnGroupsViewDefinition following this article - http://www.telerik.com/help/winforms/gridview-viewdefinitions-column-groups-view.html. The text in the headers long enough so it does not fit in the cells. Using the ViewCellFormatting event set each cell's TextWrap property to true. You will notice that the header cells are not being TextWrapped
UserAddedRow should be fired after all tasks related to the process of adding a row are completed. This will allow our users to set the current row after a row is added.
On DateTime column when IsNull or IsNotNull option has been chosen it throws exception.
When changing parent form Localization property the column's header text does not changes appropriately
CellFormatting should not me thrown for filter cell elements.
Column's FormatString property should be applied to filter cells as well.
Assigning a custom type convertor to the column's DateTypeConvertor property does not work as expected.
If current culture uses comma as delimeter, the MS Excel cannot handle the decimal values in a right way.
When exporting to excel through ExportToExcelML class, Guid type values are not exported.
When applying a filter to RadGridView, there is inconsistency between underlying data source current row and grid's current row.