how to display data in gridview from existing tables - asp.net

How to display the details in Gridview by using existing table data, suppose i have 3
tables .i.e Tables_Name: Studentdetails, Class, Section.
I want to display StudentId,StudentName,ClassName,Section in another table gridview,

Your datasource will need to be based on some query that joins the data from those three tables (can they be joined?), from there you just populate the gridview with the resulting dataset. It's hard to give any more of a detailed answer without more detail I'm afraid.

Related

Bind N Tables to one GridView Without SQL Joining

i have some tables that each one have different columns like this :
each User ( have ID ) can post to my website and Add some events, so each update goes to related table! but my problem is how show this information only in one Gridview . its something like facebook Timeline that shows your updates sorted by date .
i tried to use SQL join but its not a good way because i have 10 to 12 tables, joining all these tables is time consuming.
i want have a gridview that be bind from different tables on sort the information by their date ( each table have a date column )
sorry for my bad English.
You will need to use a single datasource for your Gridview, which means you need to join your tables in a single query, or use multiple Gridviews (one per table). I can't see why joining your tables in a query would be more time consuming than any other way you propose, assuming there was a way to do it within the Gridview, you'd just be doing the time consuming task on sort rather than on render.
Perhaps post your query and gridview code for a more specific answer.

Showing multiple records on the same row in Gridview

May I know how to show multiple records on the same row in Gridview?
the purpose of these enumerable data bound controls is to show one record/row/object per item template. If you want to show multiple records/rows/objects you will need an intermediate step to aggregate the individual record/row/object together.
then you could bind to the gridview. however, i would recommend the ListView so you can customize the layout however you like.

how to populate different records in row of a Grid?

Helo, I have a two Grid where I have to display some records from the table. The table consists of employee names ,manager names and their comments. Now on the first gird I am fetching data of employee names. Now on the second grid I have to display data of manager names and their comments. The data is on the same table.
On show button of the first grid it shows all the employees. then on AdvWebGrid.ClickLink or any selected user on the first grid , i have to display the manager names and their comments on the second grid. How can I do that ?
Hope my problem is clear?
can you use hirarchy grid?mean when you click on employee name it open a grid just below that row?i think it will be best option for you as you can use datatable in one datatable fetch all employee from table and assign them to first datatable and in other datatable fetch all manager and comments after doing all this just assign both datatable two grid datasource and create a join between them and it will work perfectly...
links
http://www.infragistics.com/dotnet/netadvantage/aspnet/web-hierarchical-data-grid.aspx#Overview
http://helpcentral.componentone.com/nethelp/c1webparts/default.htm?turl=WordDocuments%2Fdisplayingahierarchicalgrid1.htm
http://msdn.microsoft.com/en-us/library/ff407273(office.14).aspx
http://aspalliance.com/articleViewer.aspx?aId=21&pId=

How to display huge amount of data by a gridview in asp.net by NOT selecting entire data from datasource?

how can I create a query in order to select some records every time user wanna to display them into a gridview. I don't want to select all entire records from my data source. What I exactly want is to simulate pagination by query.
Thank you
Have a look at
Efficient Paging for GridView

How to Display a DataGrid with Insert Mode without any pre-filled data?

How to display the datagrid in insert mode without any data in it.
The GridView is empty and contains only one header.
I want to insert the data in the GridView when the application is running.
What you could do is using an empty Binding Source to a List which would enable you to add new Rows.
Check out some samples of how to use the Binding Source here
Please have a look at these 2 examples:
Insert rows with a GridView
Adding Insert Capabilities to the GridView
I don't think the datagrid will be rendered if its data source is empty. To work around this problem you can give it a data source with only one item that is regarded as empty (for example a data table with one row where all columns have empty values). You can then check for this special case in your program logic.

Resources