 |
|
 |
Hi, the grid is pretty cool, that's what I want.
But I am a beginner, I can't find the function to set the cell type. I just want to add 3 columns to the grid, one column is read-only, another is editable, and the other one is inplace combo.
Who can tell me how to do?
Thanks a lot!
|
|
|
|
 |
|
 |
Call m_grdResult.Create(WS_CHILD | WS_VISIBLE, rcClient, this, IDC_GRID_RESULT)
failed with error: MyProgram.exe has triggered a breakpoint if m_grdResult declared as CGridCtrl.
And this call is successful if m_grdResult declared as CListCtrl
Used Visual Studio 2005
|
|
|
|
 |
|
 |
Using DeleteItem() or DeleteAllItems() methods doesn't work properly.
After having deleted items, the first one still appeared even if it doesn't exist any longer. The GetItemCount() method returns 0.
Inserting a new item takes the place and then it is OK.
|
|
|
|
 |
|
 |
It seems to be OK replacing "return OK" with "return CListCtrl::OnEraseBkgnd(dc)" in the CGridCtrl::OnEraseBkgnd(CDC* dc) method.
;)
|
|
|
|
 |
|
 |
Was the software designed with the idea in mind that changes in individual cells could be responded to with changes elsewhere in the program? That would be in my mind's eye an obvious use of the software, but a glance at the software seems to indicate it wasn't built with this in mind. If I use this library, I plan on building this functionality myself- my question to you is how simple or difficult you think it would be and any hints you could give about what to change in order to accomplish this goal would be great.
Thanks,
Sean
|
|
|
|
 |
|
 |
I'm not sure I understand your request.
If it's about being notified when a cell has been edited, you'll just have to override OnEndInPlaceEdit(..) method. This event is triggered immediatelly after the cell is edited, but before the cell editor is destroyed.
If you do that, make sure you supercall the original method (__super::OnEndInPlaceEdit(...)).
Good luck.
|
|
|
|
 |
|
 |
Thanks for the help. I am a little surprised that I must define custom classes in order to do this. There is no way I can just catch the message generated by OnEndInPlaceEdit() so that the enclosed dialog can just get the message? It seems like poor engineering to write a special class just to overwrite one function when most of the time that isn't how you would do it anyways....
Thanks for your consideration,
Sean
|
|
|
|
 |
|
 |
CGridCtrl is an abstract class. It's not supposed to be used directly.
I had good reasons to "engineer it poorly", and when you'll use all of its features, you'll find out why.
In conclusion, the answer is NO. You can't.
Bye
|
|
|
|
 |
|
|
 |
|
 |
I select a cell (whatever its type) by a simple click.
Then, when I enter characters, they appear in a yellow rectangle (which looks like a tooltip rectangle) at the top of the grid.
It's not cool.
Else, the component is great.
Forest
|
|
|
|
 |
|
 |
This is a feature called "incremental search" and it can be disabled by calling SetIncrementalSearch(false).
|
|
|
|
 |
|
 |
Thanks Marius,
That's OK, it works with SetIncrementalSearch(false)
Note there is a small error in the code. The function is called 'SetInctementalSearch' instead of 'SetIncrementalSearch'
Forest
|
|
|
|
 |
|
 |
I've noticed.
Sh*t happens
|
|
|
|
 |
|
 |
what is the dsStyle in the Create Function.
|
|
|
|
 |
|
 |
I just want to know how I can get the text from an edit field from for example Col 1 and Row 1?
_____________________________
...and justice for all
APe
|
|
|
|
 |
|
 |
Hello, I have (MFC CGridCtrl) a Grid and would like at run-time of the program a Row to add that would like I however not with a Button to make number of lines to be supposed to be dynamic. so that if I am on the last Row and press return that a new Row is added can me someone help?? Thanks.
|
|
|
|
 |
|
 |
First of all: it's a great control, thanks Marius.
2 features I currently miss are sorting and full row select. If I change the list control properties to switch sorting on a lot of the grid cells are empty. How to overcome this? And how to disable the cell based selection?
Moreover, I have some 'nice to haves'. Maybe we can discuss this directly, Marius? My mail address is tm@trustedsoft.de, so please drop me a line how I can contact you directly.
|
|
|
|
 |
|
 |
- good news: I have a new version of the grid control (it will be posted soon) that has some new features: Custom Item Height, Disabled Cells, Sorting support
- bad news: Full row selection isn't (and won't be) supported. In fact that's the reason I've written this grid; to work at cell-level
|
|
|
|
 |
|
 |
Thanks. I can live with that, sorting is the more important feature. Please tell me when you release the new version.
|
|
|
|
 |
|
 |
Hello there
I want to be able to change the colour of the scroll bar of the grid (both the vertical and horizontal) and ignore the user selected coloring scheme.
Any idea will be appreciated
Thanks
Alex
|
|
|
|
 |
|
 |
First of all, very cool work Then the minus :
1- You have to click two times to edit a cell, first time to select it (get the focus), second to edit/open the cell
2- On combo, you have to click three times ! One to select, one to edit the text, one to choose the icon !
3- When you get the focus on a combo, for instance the third column, first line, and click a second time to edit the text, if you click another combo (the combo below for instance), the grid crash badly :/
4- Some memory leaks
Kochise
In Code we trust !
|
|
|
|
 |
|
 |
Thanx for your feedback. You were totally right, so I came up with updates.
1 & 2 - Cell editing flow was heavily optimized
3 - Indeed, there was a crash. Fixed.
4 - There weren't any memory leaks except the stack garbage after the crash at (3). The code was carefully tested with BoundsChecker.
|
|
|
|
 |
|
 |
When selecting a combo, it opens right. When selecting another combo elsewhere, it sure no more crash, but enter the text edit mode instead to close/exit text edit, and focus the new combo ! Otherwise, cool
Two cool grid classes also :
- http://www.codeproject.com/miscctrl/virtgrid.asp
- http://www.codeproject.com/treectrl/ctreelistctrl.asp
Kochise
In Code we trust !
|
|
|
|
 |
|
 |
Kochise wrote:
1- You have to click two times to edit a cell, first time to select it (get the focus), second to edit/open the cell
IMHO that's the correct behaviour, since it's the same way as renaming files in the Explorer.
Regards
Thomas
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
 |
|
 |
Correct, but when you are in edit mode, there is not standard of what should be done :
- Discard the new value as it was not validated with Return
- Or save the new value, exit edit mode of the current cell and immediatly entetr edit mode of the new selected cell (unless you press Esc to exit any edit mode)
- Or close everything
- Or...
I'm just telling Marius that in a case of such a grid, you may enter a large number of values. Then validating, selecting, reselection to enter edit, edit, unselecting and then should be too much... Try Excel, select a cell, enter some text, select another cell once, enter some text, ... You get the idea ? So my expected behavior should be :
1- Select different cells
2- Select a second time to edit, or direct keyboard input
3- Esc to discard, Return or loose focus to validate
Kochise
In Code we trust !
|
|
|
|
 |