I would like a textbox to show nothing if the value coming from the database is NULL.
Currently, it is a number so it shows '0'. If the value is '0', I would like it to show nothing.
Using the GetValueJavaScript attribute, can you write add an if statement to the this attribute?
Thanks.
Yes, there is a way, you can try this approach:
<ig:RowEditingClientBinding ColumnKey="Date" ControlID="control_Date" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />
Let me know about the results.
Thanks for replying.
When I use your code, I get an error "Reference Error: Undefined".
This is my code:
<ig:RowEditingClientBinding ColumnKey="Lat" ControlID="txtLatEdit" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value} == null ? '' : {value}" />
Hello,
I have created a sample for you in order to show you my approach. I hope you will benefit from it. If the issue still persist, could you please make the necessary changes in order to reproduce it into the sample and return it back to me.
Looking forward to hearing from you.
Thanks for your reply.
Unfortunately, I cannot run your application. You are using a later version of the webdatagrid. I am using v11.2. Your version is v14.2.
Is the ability to set the javascript something that was added to a later version of the datagrid and not available in v11.2?
The only other difference I see is that my control is a textbox and your controls are either Date fields, currency or integer fields.
Thanks,
Gloria
I tried copying your code to my application and I still get the same error...ReferenceError: undefined.