This is a migrated thread and some comments may be shown as answers.

unknown Error , unknown Version.

1 Answer 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ms
Top achievements
Rank 1
ms asked on 18 Oct 2012, 01:14 PM
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;
}

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 Oct 2012, 08:44 AM
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.
Tags
General Discussions
Asked by
ms
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or