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?
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.
Hi
I had few doubts,
1.cells tag property used to store another information , can i store id in it and value will display in cell,
similar like value memeber , display memeber in combo. if then if the columns gets sorted what will happen to cell' tag value , will synchronize with cell or not?
eg:
Ultragrid1.Rows(i).Cells("Part").Value= dtItems.Rows(i)("PartDescription")
Ultragrid1.Rows(i).Cells("Part").Tag = dtItems.Rows(i)("PartID")
then can i sort the part column?
Thank you
Hi,
I'm sorry, I don't understand your question.
The Tag property is not used by the grid. The property exists so that you can store extra information in it.
So my suggestion is that you create a class that has properties for all of the information you need to store and store an instance of this class in the Tag property of the cell.