Skip to main content
We have to create detailed grid so how can we bind multiple values in that ?
Hi Ashwini,



Let me check if I understand your meaning.



Do you mean you want to bind multiple data subjects to the same grid to show a kind of master detail relationship in it?



Regards,

Erik
Hey Ashwini,



I would like to help you create such a grid but I do need some more information about what you want to create. What do you mean by a detailed grid? And what do you mean by binding multiple values?



With binding values, to me it sounds like you want to create a view where you are able to have data from multiple tables in one view (/screen). Views can be created just like tables in the Software Factory but require some SQL-code when the 'Creation method' equals to 'Template'. The code you can write in 'Functionality' and then assign to your created view.



Edit: Erik was a little earlier than me 😉
Actually we want to show multiple values in single column inside grid

e.g. I have multiple products and I want display name and price of each product in particular column



-----------------------------------------------------

name: Mobile | name: Printer |

price : 10000 | Price: 300 |

------------------------------------------------------

name: monitor| name: Mouse |

price : 10000 | Price: 300 |

-----------------------------------------------------
Like this?:







Values could be replaced by 'From dbo.product x'

And if the prices are in a different table, a join is needed
Below bicycle can we display its price in same column?
Below bicycle can we display its price in same column?



I understand what you are trying to accomplish. The problem is that normally a column is one set of data like a product_name. To make one column work like normally multiple columns work in a data row requires a lot of difficult coding.



Why would you like the price to be under the product name in the same column? Is this a design that you would like? Then you could post an idea here on the Thinkwise Community.



I think what you want is not a horizontal list like: product, price, picture



But a vertical one like:

product

price

picture



Is this what you would like?
Yes that is what I was trying to do but I guess it is not possible we will show it as per we see in sql table.

I have one more question:

I want to achieve one more functionality, I want to select one entity from left side list and add it to right side list and vice a versa how can I make it achieve?

What controls I will have to use?

[List 1]-----------------------------[List 2]

item1....………………………….. item4

item2 ….……..<........ > .........item5

item3 ..............................…...item6

------------------------------------------------
You could use the drag and drop functionality to drag one item from one list to the other list. See here for a full explanation: https://community.thinkwisesoftware.com/blogs-21/drag-drop-of-records-68



So in your case, I would suggest two views; one view with the items to be dragged and one view where the items need to be dragged to. Then upon dragging, the items that have been dragged to the other view should not be visible in the view where the items where dragged from.



If my answer was the answer you were looking for, you can select my answer as 'Best answer' 😉
Hi Mark,



The article provided you is very helpful.

I have followed as given in the article. I have created tables(warehouse,article,location)



Do I need to give relations among them?



Thanks and Regards,

Ashwini
Hey Ashwini,



Relationships are optional. Drag and drop should work even without any relationships between the source and the destination.



Kind regards,

Mark Jongeling
Hi Mark,



I am trying to do the same thing as given in the article, so could you please help me which columns should I define for these tables (warehouse,article,location).



Currently I have id ,name for each table. Is it correct ?



Regards,

Ashwini
Hey Ashwini,



That is correct Ashwini, the only thing that you truly need are the id's. All other details can be obtained and changed/copied by SQL-queries in the functionality of the task.
Hi Mark,



Do you have any example for task with SQL-queries ?



Regards,

Ashwini
Hey Ashwini,



I made a case application in the past which I will use here. It's a song contest where countries can vote for each other. The country with the most points win. I used drag and drop to let countries vote for other countries. Dragging a to-vote-on country onto points will make them have that amount of points.



My drag and drop task has the following code:



update vote

set points_go_to = @point_go_to

where year_of_contest = @year_of_contest

and round_name = @round_name

and country_id = @country_id

and points = @points



Vote table:

year_of_contest

round_name

country_id

points

points_go_to



When I create a round I already insert records into Vote so only the points_go_to column is empty in the beginning. That's what this drag and drop task will fill. Points go to = Country I vote for.



Before drag and drop, the record in my table Vote is:

year_of_contest 2121

round_name Semifinals 1

country_id Georgië

points 12

points_go_to Null





The application:





The task:





I connected the task in Table task to the table Vote in which I record the Votes. Then from my view with countries where I can vote on, I make drag and drop possible. My source (the view with countries) and my target (table Vote) activate my task and will run the code earlier said in this post.



@year_of_contest: comes from my view = year of the contest (2121)

@round_name: comes from my view = current round (Semifinals 1)

@country_id: comes from my view = the country that is currently voting (Georgië in my case)

@points: is where I drag to, in my case the 12 points

@point_go_to: comes from my view = the country (België in my case)



After this, the record in my table Vote is:

year_of_contest 2121

round_name Semifinals 1

country_id Georgië

points 12

points_go_to België



It's nothing more than this. Drag and drop doesn't have to be difficult.



Addition: I made a process flow so when I drag a country to an amount of points, it will refresh my Vote table so I immediately see which country I voted for.



I hope this helps you a lot 😄

Reply