Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
888
Converting UltraGridColumn DataType
posted

I am having an issue converting the datatype for a UltraGridColumn.  I am binding the datasource programmatically, and the column contains a phonenumber which is stored in the database as a string (formatted as 5558581942). 

The following properties for the relavent column are being set in the "InitializeLayout" event of the UltraWebGrid:

  • [UltraGridColumn]."DataType" is being set to "System.Int64".
  • [UltraGridColumn]."Format" is being set to "(###) ###-####".

When I try to look at the value for the cell in the "InitializeRow" event for the UltraWebGrid - the column datatype is still showing "System.Int64", but the value that is display is still 5558581942, rather than (555) 858-1942 (It should also noted that the Value property believes that the type it has is an "System.String").  All the following properties and methods return the wrong value : GetText(), Value, Text.

 Any suggestions?

 Chad

Parents
No Data
Reply
  • 625
    posted

    For the phonenumber column, the format you specified results in a string, which cannot be displayed in a column of type Int64. (It works in the Date/Time column because the format you specified is a valid Date/Time format). Try changing the data type to a string for the formatted phone number.

Children
No Data