To reproduce: 1. Perform searching in the grid. 2. Group by a random column. 3. Navigating with next/previous buttons do not navigate the results in the displayed order. Workaround: set the EnablePaging property to false.
I've attached a sample project. Here are the steps to repeat this issue:
1. Run the application
2. Click column A and drag it to the right to reorder it, scrolling the window as it goes
3. You are eventually presented with a NullReferenceException
You may have to try this several times with different columns before the problem manifests. I have found that moving just beyond the right edge of the main form and moving the mouse cursor up and down a little helps. I appears this problem only occurs in grids with many columns, so that fast scrolling can occur for multiple seconds when reordering columns.
Workaround:
Sub New()
InitializeComponent()
Me.RadGridView1.GridViewElement.RegisterService(New MyRadGridViewDragDropService(Me.RadGridView1.GridViewElement))
End Sub
Public Class MyRadGridViewDragDropService
Inherits RadGridViewDragDropService
Public Sub New(gridViewElement As RadGridViewElement)
MyBase.New(gridViewElement)
End Sub
Public Overrides ReadOnly Property Name As String
Get
Return "RadGridViewDragDropService"
End Get
End Property
Protected Overrides Sub PrepareDragHint(dropTarget As Telerik.WinControls.ISupportDrop)
Dim dragDropBehavior As IGridDragDropBehavior = Me.GetDragDropBehavior()
If dragDropBehavior Is Nothing OrElse dragDropBehavior.DragHint Is Nothing _
OrElse dragDropBehavior.DragHint.Image Is Nothing Then
Return
End If
Dim dropTargetItem As RadItem = TryCast(dropTarget, RadItem)
If dropTargetItem IsNot Nothing AndAlso dropTargetItem.ElementTree IsNot Nothing _
AndAlso Not dropTargetItem.ElementTree.Control.Equals(Me.GridViewElement.ElementTree.Control) Then
Return
End If
dragDropBehavior.UpdateDropContext(TryCast(Me.Context, ISupportDrag), dropTarget, Me.beginPoint)
Dim hintSize As Size = dragDropBehavior.GetDragHintSize(dropTarget)
Dim image As New Bitmap(hintSize.Width, hintSize.Height)
Dim temp As Graphics = Graphics.FromImage(image)
dragDropBehavior.DragHint.Paint(temp, New RectangleF(PointF.Empty, hintSize))
temp.Dispose()
Dim dragHintWindow As New RadLayeredWindow()
GetType(RadGridViewDragDropService).GetField("dragHintWindow", _
Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance).SetValue(Me, dragHintWindow)
dragHintWindow.BackgroundImage = image
End Sub
End Class
To reproduce:
- Add some columns to the grid, make sure that most of the columns are not visible (the user must scroll to view them).
- Drag and drop the second column at the last position in the grid.
- The result can be seen on the attached image.
Workaround:
Private Sub Columns_CollectionChanged(ByVal sender As Object, ByVal e As Telerik.WinControls.Data.NotifyCollectionChangedEventArgs)
Me.RadGridView1.TableElement.ViewElement.UpdateRowsWhenColumnsChanged()
End Sub
When scrolling to the bottom of the grid with the mouse, the last row is not lined up with the bottom of the grid. Also, when doing this, clicking on any row, leads to row jumping down to align properly, but a different row is selected.
Workaround:
public Form1()
{
InitializeComponent();
radGridView1.MouseDown+=radGridView1_MouseDown;
radGridView1.MouseUp+=radGridView1_MouseUp;
}
bool scrolling = false;
private void radGridView1_MouseDown(object sender, MouseEventArgs e)
{
ScrollBarThumb thumb = radGridView1.ElementTree.GetElementAtPoint(e.Location) as ScrollBarThumb;
if (thumb != null)
{
scrolling = true;
}
}
private void radGridView1_MouseUp(object sender, MouseEventArgs e)
{
if (scrolling)
{
scrolling = false;
int scrollBarValue = radGridView1.TableElement.VScrollBar.Value;
radGridView1.MasterTemplate.Refresh();
radGridView1.TableElement.VScrollBar.Value = scrollBarValue;
}
}
To reproduce:
public abstract class Base
{
public abstract string Name { get; }
}
public class Child : Base
{
public override string Name
{
get { return "Child"; }
}
}
public class Child2 : Base
{
public override string Name
{
get { return "Child2"; }
}
}
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
public RadForm1()
{
InitializeComponent();
var list = new List<Base>();
list.Add(new Child());
list.Add(new Child());
list.Add(new Child2());
radGridView1.DataSource = list.ToArray();
}
}
Workaround:
radGridView1.DataSource = list;
When RadGridView is displaying a self-referencing it should be able to show the data with ColumnGroupsViewDefinition and HtmlViewDefinition.
Workaround: use custom editor element
private void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
{
if (e.EditorType == typeof(RadMultiColumnComboBoxElement))
{
e.EditorType = typeof(MyRadMultiColumnComboBoxElement);
}
}
public class MyRadMultiColumnComboBoxElement : RadMultiColumnComboBoxElement
{
protected override Type ThemeEffectiveType
{
get
{
return typeof(RadMultiColumnComboBoxElement);
}
}
protected override void ProcessKeyDown(object sender, KeyEventArgs e)
{
base.ProcessKeyDown(sender, e);
FieldInfo fi = this.GetType().BaseType.BaseType.GetField("oldTextValue", BindingFlags.Instance | BindingFlags.NonPublic);
fi.SetValue(this, this.textBox.Text.Substring(0, this.textBox.SelectionStart));
}
}
To reproduce: - Add textbox and checkbox columns to a grid the checkbox column should not be visible without scrolling to the right. - Change the data source in the FilterChanged event. - Test this by moving the checkbox column in front of the text box column.
To reproduce: 1.Populate RadGridView with data and enable Excel-like filtering. 2.Click on a column filter icon and type in the Search textbox so more than two results appear. Then, click OK 2.The grid returns correct result. 3. Click on the previous column filter icon and navigate to Available Filters -> Contains 4. Evaluate the initial pop up dialog. Its conditions should be "Contains" and "Contains". Actually, it shows "Equals" and "Equals" according to the available filter. Workaround:By using the CreateCompositeFilterDialog event you can replace the default CompositeFilterForm with your custom one where you can load the selected filter operators.
To reproduce: 1. Populate RadGridView with data 2. Export the grid by using the SpreadExport 3. Open the produce Excel file and select some cells to generate a chart in Excel. You will notice that it is not possible to create a complete chart with the selected data. Workaround: use the ExportToExcelML >> http://www.telerik.com/help/winforms/gridview-exporting-data-export-to-excel-via-excelml-format.html
To reproduce:
private void Form1_Load(object sender, EventArgs e)
{
this.customersTableAdapter.Fill(this.nwindDataSet.Customers);
GridViewMultiComboBoxColumn col = new GridViewMultiComboBoxColumn("MCCB column");
col.DataSource = this.customersBindingSource;
col.DisplayMember = "ContactName";
col.ValueMember = "CustomerID";
this.radGridView1.Columns.Add(col);
this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
}
private void radGridView1_UserAddingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e)
{
if (e.Rows.First().Cells[0].Value+"" =="ALFKI")
{
MessageBox.Show("Please select a product", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
e.Cancel = true;
this.radGridView1.BeginEdit();
}
}
Please refer to the attached gif file.
Workaround: use the NumericUpDown.MouseDown event and call the RadGridView.BeginEdit method instead of activating the editor in the UserAddingRow event.
When the current cell belongs to one of the data rows and you click with the left mouse button over a GridFilterCellElement , the editor is activated. However, if you navigate with the arrow keys, the editor is not activated and the user can not see any indication about the current cell.
Workaround:
private void radGridView1_ViewCellFormatting(object sender,
Telerik.WinControls.UI.CellFormattingEventArgs e)
{
GridFilterCellElement filterCell = e.CellElement as GridFilterCellElement;
if (filterCell != null)
{
if (filterCell.IsCurrent)
{
filterCell.BorderWidth = 3;
}
else
{
filterCell.BorderWidth = 1;
}
}
}
Description: When you pin data rows from the child template to PinnedRowPosition.Top, it does not affect the row. However, when you pin the certain row to PinnedRowPosition.Bottom, the behavior is correct. The same issue is detected for the header rows from the child template.
1.Different naming of RadGridView templates (in the Smart tag - Relations section and in the Property Builder - Relations section) is confusing. 2.Column reordering via drag and drop in the same template. This action will change the object order of the grid. All changes are shown in the Preview section: I can select columns listed in the object tree, but cannot drag them up or down within a template. The only way I can reorder columns in the property builder appears to be by dragging them left or right in the preview pane. 3.Column moving via drag and drop from one template to another template. This action will change the object order of the grid. All changes are shown in the Preview section: I cannot move columns in the object tree from one template to another. 4.Template reordering via drag and drop. All changes are shown in the Preview section: drag and drop operation for templates in not allowed. 5.There is a right-click context menu for the object tree, with the following options: "Edit", "Expand / Collapse", "New", "Delete". Under no circumstances do the options "Edit" and "New" ever become enabled. 6.The preview pane displays a preview of the columns for the master template. When the child template is selected, the preview pane still shows a preview of the columns for the master template. As such, it is not possible to reorder columns for child templates in the preview pane. 7.When you set up the RadGridView hierarchy automatically at design time and open the Property Builder, all templates are visualized. It is possible to select/deselect columns from the different templates. It is possible to change columns names. However, when you press the OK button and close the Property Builder, try to reopen it. As a result you will notice that all columns from all child templates are selected and all columns contain the default names, no matter what changes were performed. Refer to the corresponding help article http://www.telerik.com/help/winforms/gridview-design-time-support-property-builder.html
Workaround:
Private Sub radGridView1_CellFormatting(sender As Object, e As Telerik.WinControls.UI.CellFormattingEventArgs)
If e.CellElement.IsPinned Then
If e.CellElement.RowElement.DrawFill Then
e.CellElement.DrawFill = False
Else
e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local)
End If
End If
End Sub
Here is how this issue can be worked around:
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e) { ((RadMultiColumnComboBoxElement)e.ActiveEditor).AutoSizeDropDownToBestFit = true; ((RadMultiColumnComboBoxElement)e.ActiveEditor).DropDownAnimationEnabled = false; }
When one exports a grid with text written in right-to-left the exported file has all text written in left-to-right.
Use the attached sample project. Workaround: hide the columns programmatically at run time.
To reproduce: - Use RowFormatting to change the font style to bold. - Call the BestFitColumns method.
To reproduce:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.RadGridView1.DataSource = Me.ProductsBindingSource
Me.ProductsTableAdapter.Fill(Me.NwindDataSet.Products)
Dim obj As New ConditionalFormattingObject("MyCondition", ConditionTypes.Greater, "30", "", False)
obj.CellBackColor = Color.SkyBlue
obj.CellForeColor = Color.Red
obj.TextAlignment = ContentAlignment.MiddleRight
Me.RadGridView1.Columns("UnitPrice").ConditionalFormattingObjectList.Add(obj)
End Sub
Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
Dim mySQL As String = "SELECT * FROM Products where ProductName = 'Chaii'"
Dim myTable As DataTable = getDataInTable(mySQL, My.Settings.NwindConnectionString)
Me.RadGridView1.DataSource = myTable
End Sub
Public Shared Function getDataInTable(mySQLorTable As String, myConnectionString As String, Optional myTimeout As Integer = 30) As DataTable
Using myConnection As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Nwind.mdb")
Dim myCommand As New OleDb.OleDbCommand(mySQLorTable, myConnection)
myConnection.Open()
Dim myDataTable As New DataTable
Dim myAdapter As New OleDb.OleDbDataAdapter(myCommand)
myAdapter.Fill(myDataTable)
Return myDataTable
End Using
End Function
When you click the button, the grid is refilled with the query result which does not contain any rows. As a result, a DataException is thrown for each column: "There is no property descriptor corresponding to property name: 'ColumnName'" .
Workaround: clear the conditional formatting objects, reset the DataSource and add the conditional formatting objects back