errors when migrating from Q1 SP2 to Q2

2 posts, 0 answers
  1. shortie
    shortie avatar
    23 posts
    Member since:
    Jul 2008

    Posted 19 Jul 2010 Link to this post

    We got these errors when trying to upgrade our Q1 SP2 projects:

    1. no 'VisualElement' property
    GridViewRowInfo r = radGridView.Rows[i];
    r.VisualElement.ForeColor = System.Drawing.Color.Red;

    2. no 'CellElement' property
    GridViewCellInfo gvci = radGridView.Rows[i].Cells[0];
    GridCheckBoxCellElement gcbce = (GridCheckBoxCellElement)gvci.CellElement;

    3. no 'Owner' property
    var col = (GridViewDataColumn)cell.ColumnInfo;

    Please help us to fix the above errors. Thanks in advance.


  2. Jack
    Jack avatar
    2333 posts

    Posted 20 Jul 2010 Link to this post

    Hello ChunChang,

    Thank you for your feedback:

    1. We removed the VisualElement property because many of our customers used it in a wrong way. This property was safe to be accessed only when handling the RowFormatting event. In fact you can use it only for testing purposes. You should handle RowFormatting event instead. For example:

    void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
        if ((int)e.RowElement.RowInfo.Cells["ID"].Value > 10)
            e.RowElement.ForeColor = Color.Red;
            e.RowElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local);

    2. The same applies for the CellElement property. However, you can still get the cell and row elements by using GridTableElement.GetRowElement and GetCellElement methods:

    GridRowElement rowElement = this.radGridView1.TableElement.GetRowElement(this.radGridView1.Rows[5]);
    GridCellElement cellElement = this.radGridView1.TableElement.GetCellElement(this.radGridView1.Rows[5], this.radGridView1.Columns["Name"]);

    3. In the new RadGridView the data layer is a separate component that could be used without a UI. It doesn't know about the RadGridView control at all. That's why we removed the Owner property. Please describe the situation where you need access to the control. We will try to find a solution.

    I am looking forward to your reply.


    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top