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

Nullreference after setting column width

1 Answer 57 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 02 Sep 2012, 07:10 AM
I'm currently evaluating the RadListView in detail view and am getting a nullreference at runtime if I set the width of a column to anything other than the default 200 width. For instance if I go into the designer code and comment the offending line: "listViewDetailColumn1.Width = 100F;" then it works fine with no runtime errors. With that line in the code I get the nullreference error. This is using VS2010 and .Net 4.0.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 03 Sep 2012, 02:31 PM
Hi Andrew,

Thank you for writing.

We are aware of this issue. It has already been reported and logged. You can find the PITS item here: http://www.telerik.com/support/pits.aspx#/public/winforms/12125. The issue will be addressed in the next official release. For the time being, you canworkaround  it by moving the Width settings from your designer file to the form's Load handler:
private void Form1_Load(object sender, EventArgs e)
{
    this.radListView1.Columns[0].Width = 30;
    this.radListView1.Columns[1].Width = 150;
}

I hope this will help. Should you have any additional questions, do not hesitate to ask.
 
All the best,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
ListView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or