To reproduce:
private void RadGridView1_UserAddingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e)
{
radGridView1.MasterView.TableAddNewRow.CancelAddNewRow();
}
See attached video.
Workaround:
private void RadGridView1_UserAddingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e)
{
radGridView1.MasterView.TableAddNewRow.CancelAddNewRow();
radGridView1.MasterView.ViewTemplate.DataView.CurrentItem.IsCurrent = false;
}
Use attached to reproduce. With versions prior 2015.3.930 the results are different.
To reproduce: run the attached sample project and click the 'export' button. The exported file fill be automatically opened. If you select several cells from the UnitPrice column you will see at the bottom that the cell values ' total is displayed. However, if you include the summary item's value in the selection its value is not taken into consideration. If you pay attention to the cell's format, it will be General instead of custom numeric one.
Workaround:
Private Sub spreadExporter_CellFormatting(sender As Object, e As Telerik.WinControls.Export.CellFormattingEventArgs)
If e.GridRowInfoType = GetType(GridViewSummaryRowInfo) AndAlso e.GridCellInfo.ColumnInfo.Name = "DecimalColumn" Then
Dim cellSelection As CellSelection = TryCast(e.CellSelection, CellSelection)
Dim cellFormat As New CellValueFormat("### ### ###.00")
If cellFormat IsNot Nothing Then
cellSelection.SetValue(Decimal.Parse(cellSelection.GetValue().Value.RawValue.Replace(" ", "")))
cellSelection.SetFormat(cellFormat)
End If
End If
End Sub
To reproduce:
private void radButton1_Click(object sender, EventArgs e)
{
radGridView1.MasterView.TableSearchRow.SelectNextSearchResult();
}
Check the index in the search textbox, it is not updated.
Workaround:
var cell = radGridView1.TableElement.FindDescendant<GridSearchCellElement>();
if (cell != null)
{
cell.FindNextButton.PerformClick();
}
To reproduce:
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("NumberAsShort", typeof(ushort));
for (int i = 0; i < 100; i++)
{
dt.Rows.Add(i, "Row" + i, i );
}
this.radGridView1.DataSource = dt;
Workaround: use the CellFormatting event https://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells
To reproduce, perform the following steps with the attached project:
Step 1: Create Sample Database
==============================
New (Sample1.db)
Import
Save
Close
Step 2:
======
Open (Sample1.db)
Import
Save
Close
Step 3:
======
New (Sample2.db)
Import (Exception)
Workaround:
radGridView1.GridViewElement.Navigator = new MyNavigator();
class MyNavigator : BaseGridNavigator
{
public override bool SelectLastRow()
{
var enumerator = typeof(BaseGridNavigator).GetField("enumerator", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as GridTraverser;
enumerator.Reset();
return base.SelectLastRow();
}
}
Use attached to reproduce. Workaround: Use CellFormatting instead of RowFormating.
Workaround: adjust the cell/row spacing
this.radGridView1.TableElement.CellSpacing = -2;
this.radGridView1.TableElement.RowSpacing = -2;
To reproduce: run the attached sample project and press the "stream export" button.
Workaround: use the GridViewSpreadExport https://docs.telerik.com/devtools/winforms/gridview/exporting-data/spread-export
Dim spreadExporter As GridViewSpreadExport = New GridViewSpreadExport(RadGridView1)
Dim exportRenderer As New SpreadExportRenderer()
Dim fileName As String = "..\..\Export" & DateTime.Now.ToLongTimeString().Replace(":", "_") + ".xlsx"
spreadExporter.RunExport(fileName, exportRenderer)
Workaround:
private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
GridDataCellElement cell = e.CellElement as GridDataCellElement ;
if (cell!=null && cell.SelfReferenceLayout!=null)
{
foreach (RadElement item in cell.SelfReferenceLayout.StackLayoutElement.Children)
{
if (!(item is GridTreeExpanderItem))
{
item.Visibility = ElementVisibility.Collapsed;
}
else
{
item.Visibility = ElementVisibility.Visible;
}
}
}
}
Use attached to reproduce. Workaround: DragDropService.AllowAutoScrollColumnsWhileDragging = false; DragDropService.AllowAutoScrollRowsWhileDragging = false;
Use attached to reproduce.
Workaround:
this.LoadFieldList(hiddenGrid.MasterTemplate);
this.FieldList.Add(new Telerik.Data.Expressions.ExpressionItem()
{ Name = "Test", Description = "Test", Syntax = "Test", Type = Telerik.Data.Expressions.ExpressionItemType.Field, Value = "Test" });
Please refer to the attached sample project. The ResizeColumnsProportionally.gif illustrates the correct behavior of columns resizing. However, if you make a certain column with fixed size, the columns resizing is not proportional any more. The ColumnsWidthNOTAdjustedProportionally.gif demonstrates better the wrong behavior. Workaround: handle the SizeChanged event and adjust the columns' width property programmatically in order to obtain the desired widths.
To reproduce:
Public Class RadForm1
Public RadGridView1 As RadGridView
Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles Me.Load
CreateGrid()
FormatGrid()
SetDataSource()
End Sub
Private Sub CreateGrid()
Try
RadGridView1 = New RadGridView
Me.Controls.Add(RadGridView1)
Catch ex As Exception
MessageBox.Show(Me, ex.Message)
End Try
End Sub
Private Sub FormatGrid()
Dim col As GridViewTextBoxColumn
With RadGridView1
col = New GridViewTextBoxColumn
With col
.FieldName = "FieldID"
'NOTE: Comment out NullValue = "" to prevent the unhandled exception
.NullValue = ""
End With
.Columns.Add(col)
End With
End Sub
Private Sub SetDataSource()
Dim table As DataTable = Nothing
Dim row As DataRow = Nothing
table = New DataTable("GridList")
table.Columns.Add("FieldID", GetType(System.Guid))
row = table.NewRow
row("FieldID") = Guid.Empty
table.Rows.Add(row)
RadGridView1.DataSource = table
End Sub
End Class
Workaround:
Comment this line
NullValue = ""
Use attached to reproduce. Workaround - Set the position at runtime. Me.radGridView1.MasterTemplate.AddNewRowPosition = Telerik.WinControls.UI.SystemRowPosition.Bottom
To reproduce: if you pin a calculator or a hyperlink column you will notice that the cells belonging to these columns remain white. However, the cells from other column types have a light blue/gray fill color for pinned state.
Workaround:
private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.Column.IsPinned)
{
e.CellElement.BackColor = Color.FromArgb(235, 244, 252);
}
else
{
e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
}
}
To reproduce: please refer to the attached screenshot. Workaround: add the FilterDescriptor programmatically: https://docs.telerik.com/devtools/winforms/gridview/filtering/setting-filters-programmatically-(simple-descriptors)