Nullreference after setting column width

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    1 posts
    Member since:
    Aug 2012

    Posted 02 Sep 2012 Link to this post

    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.
  2. Stefan
    Stefan avatar
    2910 posts

    Posted 03 Sep 2012 Link to this post

    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: 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,
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Back to Top