Home > Project > ucoGrid, a great grid control of MFC

ucoGrid, a great grid control of MFC

November 26th, 2006

UcoGrid is develped from CGridCtrl, and provides more exciting features.

CGridCtrl is a great ctrl developed by Chris Maunder, which can display and edit tabulated data and support custom defined cell type. The lastest version is Here.

Many developers have created their new cells and developed new feathers for CGridCtrl. such as, merging and unmerging cells, printing and print preview support, etc.

Unfortunately these features have not yet been added to CGridCtrl. My main goal is to combine and improve them into one stable “ucoGrid” control. So far, most  of the takses have been complete, and the develop the  DrawCell and FormulaCell is in process now. Since there’s no schedule set to accomplish these tasks, it can take a long time. Any suggestion or advice are appreciated.

Changes log

  • 2006.07.10 Project stated, and it was named ucoGrid.
  • 2006.07.12 add the cell merge and unmerge to CGridCtrl 2.6, and call it ucoGrid(develop code).
  • 2006.07.13 add the print preview for class CGridCtrl. The print preview code comes from “Print Previewing without the Document/View Framework” by Koay Kah Hoe.
  • 2006.07.25
    • fixed the bugs when insertcolumn or insertrow. (by Niko Shi)
    • fixed the bug when set the column width to Zero or the row height to zero, the column or the row can’t hide. (by Tobert )
    • fixed the bug: the check box on the fixed cell can’t work well.
    • minor fixed (by C++ Hacker)
  • 2006.07.26

ToDo List

  1. Add the merge and unmerge support the CGridCtrl ver 2.6. Huang Wei provide a modified version on CGridCtrl ver 2.4(here) and some other developers have given some good advice and fixed some bugs. [done]
  2. More humanful Print and Print Preview support[done]
  3. More Cell types. (Multiline text item)

Download

Project , , , ,

  1. Crias
    November 24th, 2006 at 20:48 | #1

    good

  2. zhang_zkun
    November 27th, 2006 at 19:56 | #2

    you are greate,and greate job!!this modified CGridCtrl is suite for me!!thanks a lot!!

  3. zhang_zkun
    November 27th, 2006 at 21:49 | #3

    CGridCtrl 8232:
    pFrameWnd->SetWindowText(_T(”Koay Kah Hoe Print Preview”));
    ======
    CWnd* pWndPopupOwner = this;
    while (pWndPopupOwner->GetStyle() & WS_CHILD)
    pWndPopupOwner = pWndPopupOwner->GetParent();
    CString title=”";
    if(pWndPopupOwner)
    pWndPopupOwner->GetWindowText(title);

    CViewPrintPreview 95:
    GetParentFrame()->ShowWindow(SW_HIDE);
    =======
    CWnd* pWndPopupOwner = this;
    while (pWndPopupOwner->GetStyle() & WS_CHILD)
    pWndPopupOwner = pWndPopupOwner->GetParent();
    if(pWndPopupOwner) pWndPopupOwner->SetFocus();
    GetParentFrame()->DestroyWindow();

  4. zhang_zkun
    November 27th, 2006 at 22:07 | #4

    CGridCtrl 8232:
    pFrameWnd->SetWindowText(_T(”Koay Kah Hoe Print Preview”));
    ======
    CWnd* pWndPopupOwner = this;
    while (pWndPopupOwner->GetStyle() & WS_CHILD)
    pWndPopupOwner = pWndPopupOwner->GetParent();
    CString title=”";
    if(pWndPopupOwner)
    pWndPopupOwner->GetWindowText(title);
    pFrameWnd->SetWindowText(title)

    CViewPrintPreview 95:
    GetParentFrame()->ShowWindow(SW_HIDE);
    =======
    CWnd* pWndPopupOwner = this;
    while (pWndPopupOwner->GetStyle() & WS_CHILD)
    pWndPopupOwner = pWndPopupOwner->GetParent();
    if(pWndPopupOwner) pWndPopupOwner->SetFocus();
    GetParentFrame()->DestroyWindow();

  5. November 27th, 2006 at 22:13 | #5

    hello,zhang_zkun. Is there any bug you found?

  6. zhang_zkun
    November 27th, 2006 at 22:33 | #6

    I use it in DLL, and I Detected memory leaks.
    I think the problem is in CGridCtrl 8214 line;
    there we “new CSingleDocTemplate”,but not “delete it”

    if we use “GetParentFrame()->DestroyWindow()” at CViewPrintPreview 95 line, It’s OK.

  7. November 27th, 2006 at 23:10 | #7

    oh, It works well. Thank you, zhang_zkun.

  8. Thomas
    December 1st, 2006 at 03:58 | #8

    I suggest small corrections in description:

    ex: “But these features have not been add to CGridCtrl. So I want to integer all the features into CGridCtrl and improve some cells. There is no time plan and it may take a long time.”

    should look like:

    Unfortunately these features have not yet been added to CGridCtrl. My main goal is to combine and improve them into one stable “ucoGrid” control. Since there’s no schedule set to accomplish these tasks, it can take a long time, before it is completed, assuming that it will ever be (by means of constant development).

  9. Michelangelo
    September 12th, 2007 at 22:06 | #9

    For me merging doesn’t work when in virtual mode. I’ve tested it with the compiled binary included in the latest ucoGrid.

  10. October 7th, 2007 at 12:31 | #10

    Thank you for sharing!

  11. elsvf
    December 22nd, 2007 at 17:28 | #11

    Congratulations to all for the great software of CGridCtrl
    the code placed by Niko Shi to solve the insertcolumn problem would better be place some lines earlier.
    in my version
    CGridctrl line 4290
    ////change STARTS here Other place
    // fix up column order
    m_arColOrder.resize(m_nCols); // Reset Column Order
    for (int i = 0; i < m_nCols; i++)
    {
    m_arColOrder[i] = i;
    }
    //// change ENDS here
    moved to line 4275
    after m_nCols++

    Reason: When adding the very last column in the grid there was still a problem writing his fixedcolumn title.
    replacement of the code solves this.

    Probably somebody can add this change.

    Many thanks
    elsfv

  12. Fly
    June 27th, 2008 at 18:29 | #12

    It cannot compile in vc2005/2008, Why?

  13. July 28th, 2008 at 09:59 | #13

    @fly:
    I have compiled the project in vc2005, and there is no error appears. So what about your error message?

  14. LEE
    October 9th, 2008 at 20:10 | #14

    How to customize the line around the CELL? For example, I just want to draw top line only. How can this control do this?

    Thanks,

  1. January 29th, 2007 at 07:52 | #1