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

Error in Setting Text to NULL

2 Answers 58 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Saif
Top achievements
Rank 2
Saif asked on 24 May 2014, 09:59 AM
Please tell me what is wrong with my code?
Every time i set the .Text to null it gives error "Object reference not set to an instance of an object."

public Form1()
    {
      InitializeComponent();

      DataTable dt = new DataTable();
      dt.Columns.Add("TEST");
      for (int i = 0; i < 5; i++)
      {
        dt.Rows.Add(Guid.NewGuid());
      }
      this.radMultiColumnComboBox1.DataSource = dt;

      this.radMultiColumnComboBox1.Text = null;
    }

    private void radButton1_Click(object sender, EventArgs e)
    {
      this.radMultiColumnComboBox1.Text = null;
    }

2 Answers, 1 is accepted

Sort by
0
Saif
Top achievements
Rank 2
answered on 24 May 2014, 10:08 AM
Problem solved.
Thanks for the ResetText method and its working fine.
And i still dont know why in .Text = null is error
Sorry for double posting
0
Stefan
Telerik team
answered on 26 May 2014, 07:25 AM
Hello Saif,

Thank you for writing.

The reason for the observed exception is that we are using the properties of the Text property to handle the text selection in the control. I will log this case and we will handle it in a future release. Here is a link to the item: http://feedback.telerik.com/Project/154/Feedback/Details/129142.

I have updated your Telerik Points for this report.

For the time being, you should use the method you found, or just set the Text to string.Empty (this is what the method does internally as well), instead of using null.

I hope that you find this information useful.

Regards,
Stefan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
MultiColumn ComboBox
Asked by
Saif
Top achievements
Rank 2
Answers by
Saif
Top achievements
Rank 2
Stefan
Telerik team
Share this question
or