Completed
Last Updated: 07 Jan 2016 20:35 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: GridView
Type: Bug Report
0
To reproduce: use the following code snippet and follow the steps from the attached gif file.

public Form1()
{
    InitializeComponent();

    List<Item> items = new List<Item>();
    for (int i = 1; i < 10; i++)
    {
        items.Add(new Item(i, 0, "Item" + i));
    }
    Random rand = new Random();
    for (int i = 10; i < 50; i++)
    {
        items.Add(new Item(i, rand.Next(1, 10), "Item" + i));
    }
    this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "Id", "ParentId");
    this.radGridView1.DataSource = items;
    this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
    this.radGridView1.EnableFiltering = true;
    this.radGridView1.ShowHeaderCellButtons = true;
}

public class Item
{
    public int Id { get; set; }

    public int ParentId { get; set; }

    public string Name { get; set; }

    public Item(int id, int parentId, string name)
    {
        this.Id = id;
        this.ParentId = parentId;
        this.Name = name;
    }
}

Workaround: use the basic filtering
Completed
Last Updated: 10 Feb 2016 05:52 by ADMIN
To reproduce:
- Add a ColumnGroupsViewDefinition

protected override void OnShown(EventArgs e)
{
    base.OnShown(e);
    VisualStudio2012LightTheme theme = new VisualStudio2012LightTheme();
    Telerik.WinControls.ThemeResolutionService.ApplicationThemeName = theme.ThemeName;
     this.radGridView1.BestFitColumns();
}

Workaround:
protected override void OnShown(EventArgs e)
{
    base.OnShown(e);
    this.radGridView1.BestFitColumns();
    VisualStudio2012LightTheme theme = new VisualStudio2012LightTheme();
    Telerik.WinControls.ThemeResolutionService.ApplicationThemeName = theme.ThemeName;
}
Completed
Last Updated: 15 Dec 2015 08:11 by ADMIN
Workaround: custom RadGridViewDragDropService and an override of the HandleMouseMove method, please check the attached project
Completed
Last Updated: 14 Mar 2016 09:08 by ADMIN
To reproduce:
void radGridView1_CellValueChanged(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
    if (e.Value == null || e.Value == DBNull.Value)
    {
        e.Row.Delete();
    }
}
-  Use the enter key to confirm the change


Workaround:
void radGridView1_CellEndEdit(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
    if (e.Value == null || e.Value == DBNull.Value)
    {
        e.Row.Delete();
    }
}
Completed
Last Updated: 08 Feb 2016 09:26 by ADMIN
Please refer to the attached sample project and follow the steps illustrated on the attached gif file.

Workaround: subscribe to the CellBeginEdit event and focus the grid:

public partial class UserControl1 : UserControl
{
    public UserControl1()
    {
        InitializeComponent();
        this.radGridView1.CellBeginEdit += radGridView1_CellBeginEdit;
    }

    private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
    {
        this.radGridView1.Focus();
    } 
}
Completed
Last Updated: 08 Feb 2016 09:02 by ADMIN
To reproduce:
- Create a new Visual Studio project with a single form.
- Add a RadGridView control to the form.
- Add a child Template to the RadGridView.
- In the properties of this child template, enable AutoExpand Groups.
- Close the form editor and re-open.
Completed
Last Updated: 10 Feb 2016 12:27 by ADMIN
How to reproduce:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radGridView1.DataSource = this.GetData();
        this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        this.radGridView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;

        foreach (var col in this.radGridView1.Columns)
        {
            col.HeaderTextAlignment = ContentAlignment.MiddleLeft;
        }
    }

    private DataTable GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Date", typeof(DateTime));
        dt.Columns.Add("Bool", typeof(bool));
        dt.Columns.Add("Bool1", typeof(bool));
        dt.Columns.Add("Bool2", typeof(bool));
        for (int i = 0; i < 50; i++)
        {
            dt.Rows.Add("Name " + i, DateTime.Now.AddMinutes(i), i % 2 == 0 ? true : false, false, false);
        }

        return dt;
    }

    private void radButton1_Click(object sender, EventArgs e)
    {
        this.radGridView1.PrintPreview();
    }
}



Workaround: 

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radGridView1.DataSource = this.GetData();
        this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        this.radGridView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
        this.radGridView1.PrintCellFormatting += radGridView1_PrintCellFormatting;

        foreach (var col in this.radGridView1.Columns)
        {
            col.HeaderTextAlignment = ContentAlignment.MiddleLeft;
        }
    }

    private void radGridView1_PrintCellFormatting(object sender, PrintCellFormattingEventArgs e)
    {
        if (e.Row is GridViewTableHeaderRowInfo && this.radGridView1.RightToLeft == System.Windows.Forms.RightToLeft.Yes)
        {
            e.PrintCell.TextAlignment = ContentAlignment.MiddleRight;
        }
    }

    private DataTable GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Date", typeof(DateTime));
        dt.Columns.Add("Bool", typeof(bool));
        dt.Columns.Add("Bool1", typeof(bool));
        dt.Columns.Add("Bool2", typeof(bool));
        for (int i = 0; i < 50; i++)
        {
            dt.Rows.Add("Name " + i, DateTime.Now.AddMinutes(i), i % 2 == 0 ? true : false, false, false);
        }

        return dt;
    }

    private void radButton1_Click(object sender, EventArgs e)
    {
        this.radGridView1.PrintPreview();
    }
}
Completed
Last Updated: 08 Feb 2016 15:02 by ADMIN
To reproduce:
- Add a grid to a split panel.
- Edit a cell and resize the panel without ending the edit.
- Click back in the same cell.

Workaround:
private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    BaseGridEditor editor = e.ActiveEditor as BaseGridEditor;
    var element = editor.EditorElement as RadTextBoxEditorElement;
    if (element != null)
    {
        element.TextBoxItem.HostedControl.LostFocus -= HostedControl_LostFocus;
        element.TextBoxItem.HostedControl.LostFocus += HostedControl_LostFocus;
    }
}

private void HostedControl_LostFocus(object sender, EventArgs e)
{
    this.RadGridView1.EndEdit();
}
Completed
Last Updated: 07 Feb 2017 06:26 by ADMIN
Workaround: Inherit the GridViewSearchRowInfo and override the SelectNextSearchResult method
class MyGridViewSearchRowInfo : GridViewSearchRowInfo
{
	private GridViewInfo gridViewInfo;
	private RadGridView radGridView;

	public MyGridViewSearchRowInfo(GridViewInfo gridViewInfo, RadGridView radGridView) 
               : base(gridViewInfo)
	{
		this.radGridView = radGridView;
	}

	public override Type RowElementType {
		get { return typeof(GridSearchRowElement); }
	}

	public override void SelectNextSearchResult()
	{
		if (this.radGridView != null) {

			this.radGridView.ElementTree.Control.Invoke(() => { base.SelectNextSearchResult(); });
		}
	}

}
Unplanned
Last Updated: 30 Mar 2016 08:08 by ADMIN
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.
 
Completed
Last Updated: 05 Feb 2016 13:29 by ADMIN
To reproduce:

1. Add a UserControl and drop a RadGridView in it.
2. Use the following code:

public partial class UserControl1 : UserControl
{
    public UserControl1()
    {
        InitializeComponent();
        ColumnGroupsViewDefinition view = new ColumnGroupsViewDefinition();
       
      this.radGridView1.ViewDefinition = view;
        
        view.ColumnGroups.Add(new GridViewColumnGroup("Group"));
        view.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow() );
        GridViewTextBoxColumn col = new GridViewTextBoxColumn("Col1");
        this.radGridView1.Columns.Add(col);
        view.ColumnGroups[0].Rows[0].ColumnNames.Add("Col1");           
    }
}

3. Drag the UserControl from the Toolbox to the form.

Workaround: set the ViewDefinition property after all columns are added.
Completed
Last Updated: 01 Dec 2015 14:16 by ADMIN
Completed
Last Updated: 08 Sep 2016 08:25 by Luigi
To reproduce:
- Assing context menu using one of the default properties.
Completed
Last Updated: 11 Dec 2015 09:16 by ADMIN
Completed
Last Updated: 12 Sep 2016 11:14 by ADMIN
Introduce a property to change symbol used to separate summaryItems in SummaryRowGroupHeaders.
Completed
Last Updated: 01 Dec 2015 08:36 by ADMIN
To reproduce:
GridViewHyperlinkColumn col = new GridViewHyperlinkColumn();
col.FieldName = "Name";
col.HyperlinkOpenAction = HyperlinkOpenAction.DoubleClick;

Workaround:
Use the CellDoubleClick event:
void radGridView1_CellDoubleClick(object sender, GridViewCellEventArgs e)
{
    if (e.Column is GridViewHyperlinkColumn)
    {
        string hyperlink = e.Value.ToString();
    }
}
Unplanned
Last Updated: 15 Aug 2017 10:02 by ADMIN
Unplanned
Last Updated: 30 Mar 2016 08:07 by ADMIN
To reproduce
- Add condition formatting object that changes the font.
- Add cell style that changes the background only.

Workaraound:
Use the CellFormatting event instead of a style.
Declined
Last Updated: 11 Dec 2015 16:27 by ADMIN
For now you can manually add the columns to the ExcelFilteredColumns collection when the filters are added in code:

FilterDescriptor fd = new FilterDescriptor("Value", Telerik.WinControls.Data.FilterOperator.IsEqualTo, "B");
fd.IsFilterEditor = true;
radGridView1.FilterDescriptors.Add(fd);

this.radGridView1.MasterTemplate.ExcelFilteredColumns.Add( this.radGridView1.Columns[0] );   
Completed
Last Updated: 17 Nov 2015 12:25 by ADMIN
How to reproduce: 
Public Class Form1
    Sub New()

        InitializeComponent()

        Dim col As New GridViewTextBoxColumn("Column1")
        Me.RadGridView1.Columns.Add(col)
    End Sub

    Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
        Dim sw As New Stopwatch
        sw.Start()

        Me.RadGridView1.Rows.Clear()
        Me.RadGridView1.BeginUpdate()
        Dim RowInfo
        For ii = 1 To 100000
            RowInfo = Me.RadGridView1.Rows.AddNew
            RowInfo.Cells("Column1").Value = ii
        Next
        Me.RadGridView1.EndUpdate()

        sw.Stop()
        Console.WriteLine("Elapsed: " & sw.Elapsed.TotalSeconds)
    End Sub
End Class

Workaround: add data to a collection and use bound mode