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 » How to sort CExtGridCellComboBox? Collapse All
Subject Author Date
Offer Har Oct 20, 2008 - 11:44 AM

Thanks,


Ron.

Offer Har Oct 27, 2008 - 2:55 PM

Well... is there a way to do it?

tera tera Oct 22, 2008 - 3:04 AM

I do following how to use.

Is there a problem? 


I wait for an answer from a support team.




typedef int (__cdecl * SortCellComboBox_CallBack )( const void * , const void * );


int Fn_SortNumAscending( const void * arg1 , const void * arg2)

{

    CExtGridCellComboBox::ITEM_INFO * pData1 = *(CExtGridCellComboBox::ITEM_INFO**)arg1;

    CExtGridCellComboBox::ITEM_INFO * pData2 = *(CExtGridCellComboBox::ITEM_INFO**)arg2;


    double dWk1 = atof(pData1->m_sString);

    double dWk2 = atof(pData2->m_sString);


    if ( dWk1 != dWk2 ){

        if ( dWk1 > dWk2 ){

            return 1;

        }else{

            return -1;

        }

    }

    return 0;

}




void CXGridCellComboBox::Sort( SortCellComboBox_CallBack Fn_Sort )

{

     qsort(

             m_arrItems.GetData() ,

         m_arrItems.GetSize() ,

         sizeof(m_arrItems[0]) ,

         Fn_Sort

     );

}