unknown Error , unknown Version.

2 posts, 0 answers
  1. ms
    ms avatar
    8 posts
    Member since:
    Oct 2012

    Posted 18 Oct 2012 Link to this post

    i have a vs application i don'w know what is the version used but i used Q2 2010 
    please help me to find a version or get solution of this error .

    1- 
    radGridViewContainerStock.Columns["Product_Name"].Index = 1;

    2- 
    private void radGridViewContainerStock_ViewCellFormatting(object sender, CellFormattingEventArgs e)
     {
         e.CellElement.RowInfo.Cells["Discrepancy"].CellElement.ForeColor = radGridViewTripStock.Rows[e.CellElement.RowIndex].VisualElement.ForeColor;
    }

  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 23 Oct 2012 Link to this post

    Hi,

    Thank you for writing.

    I am not sure which version you are not able to find, since you specified that you are using Q2 2010 (of RadControls for WinForms, I assume). Probably, you do not know the version of Visual Studio, which is not so important. 

    I am not able to determine what are the errors that you observe, however, in our latest version the Index of a column cannot be set. Instead, you need to use the Move method of the Columns collection:
    radGridView1.Columns.Move(radGridView1.Columns["Product_Name"].Index, 1);

    More information is available here: http://www.telerik.com/help/winforms/gridview-columns-reordering-columns.html.

    Here is how to set the ForeColor of a cell in the grid:
    private void radGridViewContainerStock_ViewCellFormatting(object sender, CellFormattingEventArgs e)
    {
        if (e.Column.Name == "Discrepancy")
        {
            e.CellElement.ForeColor = Color.Red;
        }
        else
        {
            e.CellElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local);
        }
    }

    More example of cell formatting can be found here: http://www.telerik.com/help/winforms/gridview-cells-formatting-cells.html.

    I hope this helps.

    All the best,
    Stefan
    the Telerik team
    You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top