Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use Grid.RowAddSetMS
#1
Photo 
I am trying to add a new row to the grid via a button.  the functionality works BUT the text strings sits in the first cell and doesnt get allocated to each cell in the row. i even tried with g.FromCSV(_s, ",") and it fails. whats the proper syntax? whats the diff between RowAddSetSA (whats SA & MS mean) 

thanks   *Screenshot below

case 4
Code:
Copy      Help
    _s=
     new,new1,new2,new3,new4,Yes,new5
    out _s
    g.RowAddSetMS(0 _s 7 0)


entire code
Code:
Copy      Help
\Dialog_Editor


 Shows how to use DlgGrid variable and grid notifications.
 All this is not necessary in most cases. Instead you can define style and columns in dialog editor. Then you can add/get data using the dialog variable.

str dd=
 BEGIN DIALOG
 0 "" 0x90C80AC8 0x0 0 0 352 135 "Dialog"
 3 QM_Grid 0x54030000 0x200 0 0 352 114 ""
 4 Button 0x54032000 0x0 4 116 48 14 "Add Row"
 1 Button 0x54030001 0x4 120 116 48 14 "OK"
 2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
 END DIALOG
 DIALOG EDITOR: "" 0x2040A00 "" "" "" ""

if(!ShowDialog(dd &sub.DlgProc)) ret


#sub DlgProc
function# hDlg message wParam lParam

DlgGrid g.Init(hDlg 3)
sel message
    case WM_INITDIALOG
    
     add columns
    g.ColumnsAdd("col0,10%[]edit,10%[]edit+button,20%,16[]edit multiline,20%,8[]combo,15%,1[]check,10%,2[]read-only,15%,7" 1)
     optionally add data using CSV string
    _s=
     a1,b1,c1,d1,e1,Yes,g1
     a2,b2,"""c2""","line1
     line2","1,2",,"  g2  "
    out _s
    g.FromCsv(_s ",")
     or you can add data from an ICsv variable
    
    case WM_DESTROY
    case WM_COMMAND goto messages2
    
ret
 messages2
sel wParam
    case IDOK
#endregion

    case 4
    _s=
     new,new1,new2,new3,new4,Yes,new5
    out _s
    g.RowAddSetMS(0 _s 7 0)
ret 1

[Image: FlQxbcZ.png]


Messages In This Thread
How to use Grid.RowAddSetMS - by ilcaa - 07-23-2020, 09:16 PM
RE: How to use Grid.RowAddSetMS - by redbull2k - 07-23-2020, 10:48 PM
RE: How to use Grid.RowAddSetMS - by ilcaa - 07-24-2020, 12:16 AM
RE: How to use Grid.RowAddSetMS - by redbull2k - 07-24-2020, 01:02 AM
RE: How to use Grid.RowAddSetMS - by ilcaa - 07-24-2020, 01:50 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)