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
65
Adding property to UltraWinGrid Cell
posted

I have a wins form project and am using an UltraDataSource
where I add rows to the data source programatically.

The user enters values into the cells of the grid manually, and then presses a save button,
which then goes and carries out an action on another system by uploading a file to said system.
The application when queries the other system to get a results file. 
The application will then process the results file, displaying a message to the user of an exceptions.
What I would like to do is add 2 properties to each of the data input cells, 1, which would hold the exception
message, and 2 would hold a 'Saved' state.
If the Saved state was true, the background colour would change to green, else it would change to red...

Is it possible to 'inherit' a new cell class and use it in the grid?

Parents
  • 469350
    Offline posted

    curtic00 said:
    Is it possible to 'inherit' a new cell class and use it in the grid?

    No, this is not possible.

    However, there are a number of ways you could achieve what you want here.One way to do this would be to create a class with two properties (exception and saved state) and create an instance of this object and assign it to the cell's Tag property.

    Or you could use the same object and assign the value of a hidden, unbound column in the grid.

    If you really like the idea of exposing these properties on the cell, then you could create an extender method on the cell (assuming you are using the DotNet Framework 3.5 or higher) and keep a Dictionary which maps the cells to the data.

Reply Children