Jump to content

Several rows in the tunimdbgrid (mobile) and / or unidbgrid (desktop) for each record


Recommended Posts

Posted

Good evening,

How can I achieve the effect of several rows of the tunimdbgrid (mobile) and / or unidbgrid (desktop) for each record of the datasource; and if it is possible to do it in a unidbgrid (desktop)

example

image.png.adc8a5ab47fbe509c90cc71e1d826fde.png

thanks

Posted

Hi,

You can use one column of uniDBGrid of Desktop , HTML text and uniDBGird.ForceFit = True to show result of that column

like this in Query SELECT statement : 

SELECT '<H3>' + Produkts."Name" + '</H3>' 
        + '<ul>' + Categories."Name" + '</ul>'
        +  CASE 
            WHEN CONVERT (varchar (250)
                , STUFF (
                        (SELECT CHAR (10) + '|||' + REPLACE (ParamName,'-','') + CHAR (10) + ParamValue
                        FROM Table2
                        WHERE Table2."ID"=Produkts."ID"
                FOR XML Path ('')),1,1,'')) <> ''
            THEN '<h4>' 
                + REPLACE (CONVERT (varchar (250)
                , STUFF (    (SELECT  CHAR (10) + '|||' + REPLACE (ParamName,'-','') + CHAR (10) + ParamValue 
                        FROM Table2
                        WHERE Table2."ID"=Produkts."ID"
                FOR XML Path ('')),1,1,''))
                ,'|||','</br>')
                + '</h4>'

            ELSE ''
            END
        + '<ul><ul><h4 align="right">Цена: '
        + CAST (ROUND (Produkts."Price",2) as varchar (20))
        + ', ' + lower (Produkt."Caption") + '</h4></ul></ul>'

 

OR apply this: 

 

  • 3 years later...
Posted

How can i use code below in DBGrid. When i just copy paste this, it doesn't work.

(this code is used on mobile GridList and works)

 

function beforeInit(sender, config)
{                   

  config.loadingText=false;
  config.grouped=false;
 // config.selectedCls='';
  config.itemTpl='<table style="width:100%;white-space: nowrap;vertical-align:middle;">'+
  
                  '<tr>'+
                       '<td style="color:#0160a9;padding-left:0px;font: bold 18px/24px helvetica, arial, sans-serif" colspan="2">{0}</td>'+
                  '</tr>'+
                  
                  '<tr>'+
                       '<td style="font: 15px helvetica, arial, sans-serif;padding-top:4px;color:#535454;">{1}</td>'+
                  '</tr>'+
                  
                  '<tr>'+
                       '<td style="font: 15px helvetica, arial, sans-serif;padding-top:4px;color:#535454;width:80%;white-space: normal;word-break: break-word;">{2}</td>'+
                  '</tr>'+                                
                                                                    
                  '</table>';

}

 

Posted
3 minutes ago, PS1 said:

How can i use code below in DBGrid(this code is used on mobile GridList and works). When i just copy paste this, it doesn't work.

Hello,

Search the forum using the keyword: XTemplate

Posted

i already searched but i've found only ,,very poorly'' idea in :

 

 

 

and other in which video is not available:

 

 

i guess the second one had good solution, like in mobile ListGrid.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...