Use attached to reproduce. Workaround - Set the position at runtime. Me.radGridView1.MasterTemplate.AddNewRowPosition = Telerik.WinControls.UI.SystemRowPosition.Bottom
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:
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" });
Use attached to reproduce. Workaround: DragDropService.AllowAutoScrollColumnsWhileDragging = false; DragDropService.AllowAutoScrollRowsWhileDragging = false;
Use attached to reproduce. Workaround: Use CellFormatting instead of RowFormating.
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();
}
}
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();
}
Use attached to reproduce. With versions prior 2015.3.930 the results are different.
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;
}
To reproduce:
Use the following code
private void RadGridView1_UserAddingRow(object sender, GridViewRowCancelEventArgs e)
{
radGridView1.MasterView.TableAddNewRow.CancelAddNewRow();
radGridView1.MasterView.ViewTemplate.DataView.CurrentItem.IsCurrent = false;
}
Place the new row at the bottom. While in edit mode press tab to fill until an exception is thrown.
Workaround:
BaseGridBehavior gridBehavior = radGridView1.GridBehavior as BaseGridBehavior;
gridBehavior.UnregisterBehavior(typeof(GridViewNewRowInfo));
gridBehavior.RegisterBehavior(typeof(GridViewNewRowInfo), new CustomGridRowBehavior());
internal class CustomGridRowBehavior : GridNewRowBehavior
{
protected override bool ProcessTabKey(KeyEventArgs keys)
{
bool newRowIsInEditMode = this.IsInEditMode && this.GridViewElement.CurrentRow is GridViewNewRowInfo;
if ( newRowIsInEditMode && this.GridViewElement.Navigator.IsLastEditableColumn(this.GridViewElement.CurrentColumn))
{
this.GridViewElement.Navigator.SelectFirstColumn();
while (this.GridViewElement.CurrentColumn.ReadOnly && this.GridViewElement.Navigator.SelectNextColumn())
{ }
return false;
}
return base.ProcessTabKey(keys);
}
}
To reproduce: please refer to the attached sample project and gif file. Workaround: add the column programmatically, not at design time.
how can i insert , update or delete? i tried after choosing the data source , it shows the data correctly but when i edit or add a new item the database is not affected (allow edit,delete and add row are set to true)
Use attached to reproduce.
Workaround:
class MySpreadExportRenderer : SpreadExportRenderer
{
public override void SetWorksheetColumnWidth(int columnIndex, double value, bool isCustom)
{
if (value > 2000)
{
value = 2000;
}
base.SetWorksheetColumnWidth(columnIndex, value, isCustom);
}
}
To reproduce:
if (e.CellElement.ColumnInfo.HeaderText == "CategoryID")
{
e.CellElement.DrawText = false;
}
else
{
e.CellElement.ResetValue(LightVisualElement.DrawTextProperty, ValueResetFlags.Local);
}
Workaround:
e.CellElement.DrawText = true;
Use attached to reproduce! Workaround: remove the Begin\End update block.
Use attached to reproduce. Workaround: Set the TableHeaderHeight again after loading the layout.
To reproduce:
GridViewCheckBoxColumn chkCol = new GridViewCheckBoxColumn();
chkCol.HeaderText = "I have wrap text set yet I cannot see full column header text.";
chkCol.Width = 90;
chkCol.WrapText = true;
chkCol.EnableHeaderCheckBox = true;
chkCol.EditMode = EditMode.OnValueChange;
radGridView1.Columns.Add(chkCol);
Workaround:
private void RadGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
var cell = e.CellElement as GridCheckBoxHeaderCellElement;
if (cell != null)
{
cell.CheckBox.TextWrap = true;
}
}
How to reproduce: bind the grid using the code snippet below and enter name in the SearchRow
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
public RadForm1()
{
InitializeComponent();
this.radGridView1.DataSource = this.GetData();
this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
this.radGridView1.AllowSearchRow = true;
this.radGridView1.MasterView.TableSearchRow.InitialSearchResultsTreshold = 0;
this.radGridView1.MasterView.TableSearchRow.SearchResultsGroupSize = int.MaxValue;;
}
private DataTable GetData()
{
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Date", typeof(DateTime));
dt.Columns.Add("Bool", typeof(bool));
dt.Columns.Add("Description", typeof(string));
for (int i = 0; i < 2000; i++)
{
for (int j = 0; j < 5; j++)
{
dt.Rows.Add(i, "Name " + j, DateTime.Now.AddDays(i), i % 2 == 0 , "Description " + i);
}
}
return dt;
}
}
Workaround: in the search row, set the InitialSearchResultsTreshold property to 0 and the SearchResultsGroupSize property to int.MaxValue
public RadForm1()
{
InitializeComponent();
this.radGridView1.DataSource = this.GetData();
this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
this.radGridView1.AllowSearchRow = true;
this.radGridView1.MasterView.TableSearchRow.SearchProgressChanged += TableSearchRow_SearchProgressChanged;
this.radGridView1.MasterView.TableSearchRow.InitialSearchResultsTreshold = 0;
this.radGridView1.MasterView.TableSearchRow.SearchResultsGroupSize = int.MaxValue;
}