Display specific column horizontal based on specific row in datagridview vb.net - vb.net

Am looking for a solution to rotate the information that comes from SqlQuery as columns instead of rows using datagridview in vb.net
Eg:-this the table i want to transform from
Below what i want to display

Related

Possible to have a combobox reflect SQL data based on a selection in a datagridview that is connected to a DataSource?

I have a datagridview with records with given data from a datasource connected to a SQL Database. What I want to do is to select a row and have a combobox pull related data for a given field from the datagridview and have it populate the combobox. What I want to do is have the combobox be filtered by a field in the datagridview.
I am able to write a SQL statement to pull ALL data from a field in SQL and populate the combobox but I cannot get that to correlate with a given field from the datagridview and I do not think that is possible but I could be wrong.
Anything helps!

Merging of cells in Silverlight DataGrid

I need a datagrid control like below.
I want to implement cell merge like functionality in a datagrid in silverlight. I have some rows which display a single value and some rows return all the values for all columns.So How to implement something like colspan for a particular row in datagrid ?
Like this
Please see the link
http://social.msdn.microsoft.com/Forums/en-US/silverlightcontrols/thread/79a7b371-738a-43e5-a3e3-7a26c946aa46

binding textboxes to a table

I have two tables that are related to each other in a 1-1 relationship (each row in the main table has exactly one corresponding row in the second table).
I also have a winform in which I'd like to show the main table in a datagridview, and for each row selected in the grid to show the fields of the corresponding row of the second table in various textboxes below the grid.
I know how to bind a datagridview to a datatable. But I'm not sure about binding several textboxes to a single row in the related datatable. I don't know what is the best way to implement it.
I'm writing in VB.Net (but can read some code in C#), using VS2008.
Any help, hints or ideas will be welcomed. Thanks.
Best way to do it is that instead of using two tables, use a join and get result in a single table, bind that table to gridview, and hide columns which you don't want to display to user.
And then use cell click event of gridview and then get the index of selected row and then use
txtBoxName.Text = GridViewName["col_name",e.RowIndex].Value.ToString();

How to get text from selected row in datagridview?

I have a data grid view that displays data from a SQL table.
I need to get the text from a specific column in the selected row on a mouseclick to use it in a new SQL query.
How do I do that in vb.net?
I solved it with this:
(Datagridview1.Item("Coloumname", e.RowIndex).Value.ToString)

GridControl doesn't display the data it contains

I am using DevExpress GridControl to display information from my database through a stored procedure (ie. SELECT * FROM aTable). Unfortunately when I run the program it doesn't display any of the information, columns, etc. It displays an empty table.
I know that there is information contained by the GridView though as I have print statements that return the row count. Specifically:
Console.WriteLine(GridView2.RowCount) ' returns the number of rows that should be displayed
Console.WriteLine(myTable.Rows.Count) ' returns the number of rows that should be displayed
What should I do so that the actual data within the table (DataTable) and the DataView is displayed to the user. I know the row count is correct as when I add/remove a record the row count correlates by incrementing/decrementing.
In addition I have this same problem in C# and in Visual Basic
Ok I have the solution and it is rather easy. Go into the design view and from there go into the designer for the GridView. In there go to Columns, under Main, and add each column that you want displayed from your select statement. For each put the name that the select statement had for each column under 'FieldName' and under 'Caption' you can rename the columns to what you prefer.