If one follows the guide from the online documentation to create custom summary cell element he will no be able to use it in a custom column: http://www.telerik.com/help/winforms/gridview-cells-custom-cells.html The issue is that the GetCellType method of the column is never called for summary rows.
If one exports a hierarchy and a hierarchy row does not have child rows, the header cells of the row's child view are still exported.
1. If one enters edit mode by pressing F2, clicks to enter edit mode or comes from another cell in edit mode - the value in the cell that enters edit mode is selected and any user input removes the old value. 2. If one enters edit mode by directly hitting a numeric key the value in the cell is set to that numeric value, a decimal separator and a number of trailing zeros equal to the editor decimal places. Example: Let a cell value be 1.23 If one wants to input 4.56 (s)he will have to press 4 then select the trailing zeros and press 5 and 6.
The cell BorderLeftShadowColor, BorderRightShadowColor, BorderTopShadowColor, BorderBottomShadowColor cannot be styled through a GridViewCellStyle object.
If one exports a grid with AutoSizeRows set to true the rows that are not visible or have not been scrolled to in the grid will be exported with wrong (very small) height.
There should be an option which allows the users to turn off the escaping of special characters when exporting to ExcelML.
Currently all export mechanisms export the first child view of a hierarchy row. There should be a mechanism to allow users to choose which view to be exported.
Currently when exporting a grid if a cell value is null it is exported as an empty cell. The NullValue property of the cell column should be respected in this case.
Currently developers have access to the main table element and to the individual cells. There should be a way for developers to access the row elements.
There should be an option that allows users to change the column and row delimiters for the ExportToCSV.
There should be a way to determine if the row was deleted through the cell or row header context menu or by pressing the delete key.
There should be a way to enable the auto filter functionality of Excel when exporting a grid through ExportToExcelML.
To enable the AutoFilter for cells C1 to C4 on row 2:
ExportToExcelML exporter = new ExportToExcelML(this.radGridView1);
exporter.ExcelTableCreated += new ExcelTableCreatedEventHandler(exporter_ExcelTableCreated);
exporter.RunExport(file.FullName);
private void exporter_ExcelTableCreated(object sender, ExcelTableCreatedEventArgs e)
{
AutoFilterElement el = new AutoFilterElement();
el.Attributes.Add("x:Range", "R2C1:R2C4");
el.Attributes.Add("xmlns", "urn:schemas-microsoft-com:office:excel");
e.ExcelTableElement.Workbook.Worksheets[0].InnerElements.Add(el);
}
private class AutoFilterElement : Telerik.WinControls.UI.Export.ExcelML.ElementBase
{
protected override string StartTag
{
get { return "<AutoFilter{0}>"; }
}
protected override string EndTag
{
get { return "</AutoFilter>"; }
}
}
RadGridView.- HierarchyDataProvider property of the GridViewTemplate should be set after the GridViewTemplate is added to Templates Collection.
Steps to reproduce:
1) Add RadGridView control
2) Use GridViewDecimalColumn:
DataTable customDataTable = new DataTable();
sampleDataTable.Columns.Add("Column name", typeof(double));
3) Set the right-to-left property of the control to true:
this.radGridView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
4) Re-size the form manually until horizontal scroll-bar appears and you will notice that the left border is missing
Expected result: the left border of the GridRowHeaderCellElement is visible
Actual result: the left border of the GridRowHeaderCellElement is missing
Workaround:
this.radGridView1.ViewCellFormatting +=new CellFormattingEventHandler(radGridView1_ViewCellFormatting);
void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement is GridRowHeaderCellElement)
{
e.CellElement.BorderLeftWidth = 3;
}
}
Typo error - "Lenght" instead of "Length", located under "Text" in the GridView expression editor
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());