Print Page | Close Window

CXTPGridControl Is not supported SVG?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=24580
Printed Date: 02 August 2025 at 2:13am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPGridControl Is not supported SVG?
Posted By: hiro-ta
Subject: CXTPGridControl Is not supported SVG?
Date 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);



Replies:
Posted By: agontarenko
Date Posted: 29 July 2025 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


Posted By: agontarenko
Date Posted: 29 July 2025 at 5:52am


Posted By: agontarenko
Date Posted: 29 July 2025 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net