Home Forums WinForms controls Xceed Grid for WinForms Expanding on Datacell Class

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #12955 |

    We are trying to expand on the Datacell class but are encountering problems. For example while the displayed value may be “John’s Sausage Store”, there would be hidden properties like its identifier in the database, date last changed, who changed it, and so on. These properties would be used in the data grid itself, like if the date last changed was within the past month, the cell color would be different.

    We tried following the example with the image in the cell, but the override code for the CreateInstance method for the Cell and Row leaves behind the hidden properties and returns a Cell type, not a CustomerCell type. How can we fix this and is there another example of how to expand on an existing Cell class?

    We appreciate your help

    Imported from legacy forums. Posted by moquif (had 3080 views)

    User (Old forums)
    Member
    Post count: 23064

    We are trying to do the same exact thing. That did not work the way we wanted it to and it made the grid run really slow! I wound up creating a custom class basing it on the object class and overriding the .toString method.

    Now I can see the text I want when I do:
    thisGridRow.cells(myDate).value = myCustomObject

    Only issue now is making changes. The grid won’t let me click on the cell and make a change if there is a value in that cell.

    Imported from legacy forums. Posted by Papo (had 271 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi All,

    I had a similar issue, using an address cell. I just created a new user control, and then implemented the ICellEditor and ICellViewer interface. As I fill the grid (or after data binding) I create an addressBlob class that has the fields of the address in it. That is used as the Value for that cell. The viewer then prints the persons name in the cell during the cell_paint method, but when the editor is clicked, a form pops up little form with a full address control on it. When the user presses enter, the editor goes away, and the name reappears.

    Using a toolTip compnent, you can also make the whole address pop up as a tool tip as you scroll over each cell.

    Using this method, you should be able to paint whatever you want in the cell, based on the cells, or other cells contents.

    I haven’t had any speed issues using this method. My guess with speed problems is that you’re getting a type exception thrown somewhere, and either data-binding or the grid itself are hiding the exception from you. The grid has a big tendency to throw exceptions and catch them itself.

    Hope that helps.

    ~Christopher

    Imported from legacy forums. Posted by Christopher (had 416 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks for the great advise. I figured out why my grid was running so slow. Basically I have a column that has an id number. I was using a combo box to display the text value. The problem is that the list is huge. I’m trying to implement my own cell viewer

    when I do:

    Me.Text = Company.getManagerInfo(DirectCast(cell.Value, Double), “name”)
    e.Graphics.DrawString(Me.Text, New Font(“Courier”, 10, FontStyle.Bold), New SolidBrush(System.Drawing.Color.Black), 0, 0)

    it displays the name but also the number LOL.

    I’ll keep working on it. Thanks fo your help tho.

    Imported from legacy forums. Posted by Papo (had 4155 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.