Hi!
When i create a DataTable and show the content in a Grid there are some pre-defined fields like Location, Source etc.
In some cases i don't want to show all the columns in a Grid only a set of them. Is there a way to acomplish this in Thingworx?
Thanks
Solved! Go to Solution.
You can also use the RemoveField function for an Infotable after doing the query. From our doc...
RemoveField(fieldName)
Removes this field from the Infotable data shape (fields collection).
So you could call...
infoTableName.RemoveField(location);
infoTableName.RemoveField(source);
...
You can select the Configure Grid Columns option from the dropdown menu at the top left of the widget when it is selected in Composer design. This allows you to select visibility, order, heading and styling of each grid column.
Thanks Adam, i will check, but to have only the required columns would be better than hide them in the grid.
You should write a service which returns only the desired fields.
This was my original idea, but the way to do it is not clear.
I can create an infotable and define another datashape and fill in de required data from the datatable into the infotable row by row, but it looks odd, to do it that way.
Do you have another idea how to do it?
You don't need to create a new infotable, you query the DataTable from the service and you can remove the undesired fields ( there's snippets to do it )
You can also use the RemoveField function for an Infotable after doing the query. From our doc...
RemoveField(fieldName)
Removes this field from the Infotable data shape (fields collection).
So you could call...
infoTableName.RemoveField(location);
infoTableName.RemoveField(source);
...
Looks good, will check tomorrow.
Thanks