How to reach many grids like SQL Server Results Pane

I am having problems with my project again :(

Front end - C #

I need to support a multi-line query, such as an MS SQL server, and when these queries are executed, there will naturally be many result sets.

Obtaining data corresponding to the results is not a problem, but how to make it look the way it is done on the MS SQL server. Is one result set lower than another and with a scroll bar?

Should I bind it to a datagrid? If so, how can I bind multiple tables to a datagrid? and will it automatically generate scrollbars and columns?

If I do not understand, let me know and I will try to be more clear.

ps: If anyone knows how to do this using XtraGridControl in devexpress, that would be awesome !: D

+4
source share
3 answers

Maybe you need a System.Windows.Forms.FlowLayoutPanel control (see FlowLayoutPanel @msdn )

It is available from .NET v2 and higher.

 flowLayoutPanel1.FlowDirection = FlowDirection.TopDown; .... // for each result... flowLayoutPanel1.Controls.Add(newGrid); 

I used it before to achieve a similar effect. However, I did not try to resize the elements inside it, they were fixed in height (size in size in size corresponds to the parent).

You must create each instance of XtraGridControl with the necessary data and add it to the controls as described above.

PK :-)

+2
source

you can set a panel with scroll bars in your form and add a programmatically amount of data depending on the number of data sources. Just add a datagrid control to a specific panel.

+3
source

SQL Management Studio does not display all results in a single grid unless it is a UNION query. Adding multiple grids to one scrollable panel is the right way to do this if you don't want to split them into separate tabs.

+2
source

Source: https://habr.com/ru/post/1303540/


All Articles