We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

how to set Integer/double textbox controls to DBNull

Is there any way to set integer/double textbox to DBNull? Integer/Double textbox controls assumes that the value 0 is NullString. But in reality a numeric column can contain NULL value. There is also another issue with these controls related to the above mentioned problem. These controls are always intialized to have a value 0. Is there a way to override this behaviour (ie not to have any value on screen if it is null)?

4 Replies

AD Administrator Syncfusion Team November 4, 2003 03:59 PM

Hi Rajeev, Presently the DoubleTextBox and IntegerTextBox controls cannot handle DBNull value and they assume 0 to be the Null value. However, we have considered this as a feature request for implementation in a future release of Essential Suite. Please open an incident in DirectTrac regarding this issue and I will update you when this is accomplished. In order to set the values of the DoubleTextBox and IntegerTextBox to a null value you could set the Text property values to null as shown below : this.doubleTextBox1.Text = null; this.integerTextBox1.Text = null; In order to prevent 0 being displayed when the values are set to null, please set the following properties : this.doubleTextBox1.NullString = ""; this.doubleTextBox1.UseNullString = true; this.integerTextBox1.NullString = ""; this.integerTextBox1.UseNullString = true; I have also attached a sample application here which shows how this can be done. Thanks for your patience and cooperation. Regards, Guru Patwal Syncfusion, Inc.


RK Rajeev Kulam November 5, 2003 08:51 AM

Thanks. The controls now doesn't display 0 by default. But I still find a problem with this. It doesn't allow me to enter 0 (or show )in to these fields. As you know 0 is a valid value. How could I force these controls to display 0 when user enters it. Thanks > Hi Rajeev, > > Presently the DoubleTextBox and IntegerTextBox controls cannot handle DBNull value and they assume 0 to be the Null value. However, we have considered this as a feature request for implementation in a future release of Essential Suite. Please open an incident in DirectTrac regarding this issue and I will update you when this is accomplished. > > In order to set the values of the DoubleTextBox and IntegerTextBox to a null value you could set the Text property values to null as shown below : > this.doubleTextBox1.Text = null; > this.integerTextBox1.Text = null; > > In order to prevent 0 being displayed when the values are set to null, please set the following properties : > this.doubleTextBox1.NullString = ""; > this.doubleTextBox1.UseNullString = true; > > this.integerTextBox1.NullString = ""; > this.integerTextBox1.UseNullString = true; > > I have also attached a sample application here which shows how this can be done. Thanks for your patience and cooperation. > > Regards, > Guru Patwal > Syncfusion, Inc.


AD Administrator Syncfusion Team November 5, 2003 08:51 AM

Thanks. The controls now doesn't display 0 by default. But I still find a problem with this. It doesn't allow me to enter 0 (or show )in to these fields. As you know 0 is a valid value. How could I force these controls to display 0 when user enters it. Thanks > Hi Rajeev, > > Presently the DoubleTextBox and IntegerTextBox controls cannot handle DBNull value and they assume 0 to be the Null value. However, we have considered this as a feature request for implementation in a future release of Essential Suite. Please open an incident in DirectTrac regarding this issue and I will update you when this is accomplished. > > In order to set the values of the DoubleTextBox and IntegerTextBox to a null value you could set the Text property values to null as shown below : > this.doubleTextBox1.Text = null; > this.integerTextBox1.Text = null; > > In order to prevent 0 being displayed when the values are set to null, please set the following properties : > this.doubleTextBox1.NullString = ""; > this.doubleTextBox1.UseNullString = true; > > this.integerTextBox1.NullString = ""; > this.integerTextBox1.UseNullString = true; > > I have also attached a sample application here which shows how this can be done. Thanks for your patience and cooperation. > > Regards, > Guru Patwal > Syncfusion, Inc.


AD Administrator Syncfusion Team November 6, 2003 05:15 AM

Hi Rajeev, Thanks for bringing this to our notice. I could observe the above mentioned behavior here. I have contacted the Essential Development Team for their inputs on this issue, and will update you as soon as I hear from them. Thanks for your patience. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon