Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Grid invalidate problems, again.. Collapse All
Subject Author Date
Offer Har Feb 26, 2008 - 8:00 AM

Hi,

I have a custom cell type, which I would like to invalidate itself when the text in it is modified.

How can this be done?

Again, in the spirit of partial updates, I think the grid class should support these kind of operations internally, but I don’t mind adding it to my external classes...

Thanks,
Ron.

Offer Har Mar 3, 2008 - 6:21 AM

Dear Support,

If you still have doubt there is a problem here, let me explain.

Let’s say I have a cell called CExtGridCellRon. This cell have a function SetType(int nType).
I want that when SetType is called, no matter where from, the cell will display the type passed.
Somebody can get a pointer to that cell from anywhere. Even in OnButtonPressed of the cell itself I, want to call SetType, and not do anything else there.

The problem is that for invalidating a cell, you have to ask the grid to do it - the cell cannot do it by itself, and this breaks the OO design.

Regards,
Ron.

Offer Har Feb 28, 2008 - 8:09 AM

I know that in OnGridCellButtonPressed I have it, but I pass it to the cell to handle, so I need now pass to the cell also the row&col, which I do not do it now.

If there is no other choice that’s what I’ll do, but it would have been better if a call had a function Invalidate or Redraw, which would have been much simpler and intuitive.

Technical Support Feb 28, 2008 - 7:56 AM

If some part of a grid cell is clicked, you have not only a pointer to the cell. You also know the row and column indices, which allows you to get the rectangle of the cell and invalidate it.

Offer Har Feb 27, 2008 - 9:01 AM

Dear Support,

It is not very clear to me what you imply...
This my scenario:
1) I have grid cell, with a button. When the button is pressed, A dialog opens, and the user enters some data in it.
2) When the dialog closes, I update the cell’s text.
3) Now, I need to invalidate this cell to display the new data.
All I have to begin with, was a pointer to the cell, and now I need to invoke a function on that cell so that it will redraw itself to display the new text.

How can this be done?

Thanks,
Ron

Offer Har Feb 26, 2008 - 3:00 PM

Hi Vladimir,

Good to know that I’m not the only one facing this problem...

Hope that they will give a built-in solution for this problem, as these workarounds I consider only as last resort...

Vlad Kozatchenko Feb 26, 2008 - 2:51 PM

Hello,

(I am not from the support team).

but i had similar thought and ideas about partial repaints and cells taking care of themselves.
i could not invent something better than to let cell know pointer to to my class driver from grid. then then cell makes call to my grid which implements proper InvalidateRect() by computing it first.
so i added these kind of operations myself to the grid.

it would be better if we do not implement these methods each time in a different way.
i hope here for a answer with a better way than i have done.

thanks!

Vladimir

Technical Support Feb 27, 2008 - 3:53 AM

But in most cases the methods of grid cell classes have the CExtGridWnd & wndGrid parameter. At least all the methods related to painting, mouse and keyboard input, popup list box or any other control event notification and in-place activated control event notification have this parameter. It’s possible to instantiate one data provider object with grid cells and make several grid windows using it. Such a trick can be used for creating two or more grid windows with synchronized scrolling. That is why the grid cells know the data provider pointer and not the grid window pointer.