Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - CXTPGridControl Is not supported SVG?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPGridControl Is not supported SVG?

 Post Reply Post Reply
Author
Message
hiro-ta View Drop Down
Groupie
Groupie


Joined: 11 July 2013
Status: Offline
Points: 69
Post Options Post Options   Thanks (0) Thanks(0)   Quote hiro-ta Quote  Post ReplyReply Direct Link To This Post Topic: CXTPGridControl Is not supported SVG?
    Posted: 16 June 2025 at 11:24pm

I want to use an SVG icon for a record in CXTPGridControl.
I tried the following code, but the icon was not displayed:

CXTPGridControl* pCtrl = new CXTPGridControl();
pCtrl->Create(); pCtrl->GetImageManager()->SetVectorIcon("RT_SVG", IDR_SSI_NORMAL_IMAGE, ID_OBJ_IMAGE, 16); CXTPGridRecord* record = new CXTPGridRecord(); record->AddItem(new CXTPGridRecordItemText(objName))->SetIconIndex(0); pCtrl->AddRecord(record);

When using a BMP image as shown below, the icon was displayed correctly.
Is SVG not supported?

CXTPGridControl* pCtrl = new CXTPGridControl();
pCtrl->Create(); pCtrl->GetImageManager()->SetImageList(IDB_OBJECTSICON, 18, 0); CXTPGridRecord* record = new CXTPGridRecord(); record->AddItem(new CXTPGridRecordItemText(objName))->SetIconIndex(0); pCtrl->AddRecord(record);
Back to Top
agontarenko View Drop Down
Moderator Group
Moderator Group


Joined: 25 March 2016
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 12 hours 35 minutes ago at 5:47am
Hello,

I've replace "\ToolkitPro\Samples\GridControl\GridSample\GridSampleView.cpp" function as below
and XAML/SVG icons has been loaded

void CGridSampleView::UpdateGridIcons()
{
    CXTPGridControl* pWndGrid = &GetGridCtrl();
    ASSERT_VALID(pWndGrid);
    if (!pWndGrid)
        return;

    pWndGrid->GetImageManager()->RemoveAll();

    int nWidth                 = 0;
    CString type             = _T("RT_SVG");
    CXTPImageManager* imgMgr = pWndGrid->GetImageManager();

    nWidth = XTP_DPI_X(16);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_DOCUMENT, 0, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_EXCLAMATION_BLUE, 1, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_BOOKMARK, 2, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_MAIL, 3, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_MAIL_OPEN, 4, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_MAIL_ARROW_LEFT, 5, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_EXCLAMATION_RED, 6, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_PIN_BLUE, 7, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_PIN_RED, 8, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_SMALL_BUTTON_ARROW_DOWN, 9, nWidth);

    nWidth = XTP_DPI_X(32);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_DOCUMENT, 0, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_EXCLAMATION_BLUE, 1, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_BOOKMARK, 2, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_MAIL, 3, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_MAIL_OPEN, 4, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_MAIL_ARROW_LEFT, 5, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_EXCLAMATION_RED, 6, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_PIN_BLUE, 7, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_PIN_RED, 8, nWidth);
    imgMgr->SetVectorIcon(type, IDR_SVG_GRID_LARGE_BUTTON_ARROW_DOWN, 9, nWidth);
}


Regards,
Artem Gontarenko
Back to Top
agontarenko View Drop Down
Moderator Group
Moderator Group


Joined: 25 March 2016
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 12 hours 30 minutes ago at 5:52am
Back to Top
agontarenko View Drop Down
Moderator Group
Moderator Group


Joined: 25 March 2016
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 10 hours 59 minutes ago at 7:23am
Hello,

I'm glad to inform you that the issue has been addressed and fixed. The fix will be available in the next beta or final release.
Once you have an update installed, please make sure everything works as expected, let me know if there are any issues left.

Regards,
Artem Gontarenko
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.