Combo Box Default Value = 0

Hi,

I have (2) Data Grids. "Grid One" has a Combo Box Edit Template for a column, and "Grid Two" doesn't. However, the Combo Box column in "Grid One" is a Foreign Key to "Grid Two" as its Primary Key column.


"Grid One" Combo Box has a default value of '0'. I know that you can fix this by allowing the type to be nullable by setting "byte?" for example.

However, my problem is that the Combo Box column is the Foreign key to "Grid Two", which is the Primary Key for that "Grid Two".

Therefore, I cannot set the data type to be nullable as "byte?" because then I cannot perform correct CRUD operations in "Grid Two" because a Primary Key column cannot be nullable.


I have attached pictures related to "Grid One" & "Grid Two".


QUESTION:

How can I prevent the default value of '0' for Combo Box without setting the data type to be nullable because the Primary Key cannot be nullable in my other table?

Thank you


Attachment: Combo_Box_Default_0_81c99be9.zip

1 Reply

JP Jeevakanth Palaniappan Syncfusion Team September 8, 2021 02:02 PM UTC

Hi Kenney, 

Greetings from syncfusion support. 

We have checked your query and we would like to inform you that you need to have a nullable TValue to set a null value in the combo box. If you cannot set nullable type, then you can only use string type to achieve your requirement. 

Please get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon