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
250
Custom Cell Formatting
posted

I want to be able to apply custom formatting for some of the columns in the UltraGrid.

  • I am using UltraDataSource which has some columns of the double type
  • I am assigning this data source to UltraGrid which displays columns automatically

I want some of my double columns to be formatted in a specific way:

  • If the value is round, it should be displayed as is, for example 128.(0) should be displayed as simply 128
  • If the value has a fractional part, it should be displayed as a multiple of 1/32, for example 128.21875 should be displayed as 128.7/32

I also want this values to be editable and displayed in the same format while editing.

There is a way to achieve this for the standard Microsoft data grid by overriding the following methods of the DataGridTextBoxColumn:

  • GetColumnValueAtRow
  • Commit
  • See http://support.microsoft.com/default.aspx?scid=kb;en-us;Q318581

But is there a way to do it for the UltraGrid?

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    The methods you refer to here in the DataGridViewColumn seem like that are similar to the DataFilter. The DataFilter allows you to intercept and modify the value as it moved from the editor to the display and vice versa.  

Children