I have ASP.NET GridView in my web app and would like to bind 3 columns with values based on one column - asp.net

I have ASP.NET GridView in my web app and would like to bind 3 columns with values based on one column. I am providing example below, is it possible to implement into GridView?
My Gridview fields are
Name|Score1|Score2|Score3
I will display the name but how to fill the score fields based on name.there are 3 scores corresponding to each name,that we taken from the same table with a single score field.the 3 scores are provided by 3 different persons.Also i want to display the corresponding score providers name in the header portion of the gridview.
ie,
Name|Ram Score1|Raju Score2|Mohan Score3
How can i do this...
Plz provide the query to do this

Consider to rather calculate the scoring fields in database. Create a stored procedure and bind it to the grid view.

Related

How to design a gridview or table with datasource having blank first row in which we can search table column in asp.net?

I want to design a grid view or table that gets data from database then i want leave first row blank. when user click in the cells of first row and type in, it shows every data that matches.
You can use textBoxes to query your requested data in gridView and use onTextBoxChanged to update the gridView. Instead of increasing the code you also can do it using Table let's say you have 5 columns on the gridView you make table with 5 columns and 2 rows, the first row you put 1 textBox in each cell, in the second column you use colspan property and set it to 5. Then use the event onTextBoxChanged call the SQL command and query the data on textBox then update the gridView.

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.

asp.net dynamic data websites insert of associated tables in the same form

Im trying asp.net dynamic data websites. I have a customers table and a customers-telephones table. The dynamic data website creates 2 separated forms for the insert in these tables, and I need my form to have the insert of the customer and the insert of the telephones to be in the same form for requirements of the buyer. is it possible to modify something to have the insert of these 2 tables in the same form and with only one accept button?
You can either create a nested gridview, or you can de-normalize your data, giving a fixed maximum of phone numbers per customer.
If you say your customers have maximum 3 different phone numbers (e.g. land, mobile and fax) you can just add these as three new columns on the customers table. In that case you will only need one insert (and one form) to add a customer and all his/her phone numbers.

InfoPath: How to display a third column of a datasource?

I have an InfoPath 2007 browser-enabled form that has a datasource with three columns, let's say columns A, B, and C. I have a dropdown that is keyed to column A and displays column B. Column C contains some data that I want to display in an expression box, and that I also want to use in some data validation against another field on the form. I'm looking for some help on how to reference that column C for displaying and use in validation. Thanks!
You can access it by drilling down in the Data Source. If you don't see it, maybe its not a compatible data type (i.e. Multiline text).

How do I manually add additional rows to the bottom of an ASP.NET gridview?

I have a situation where I'm populating a gridview with a bound data source, and want two additional rows at the very bottom; one to show the sum of values in the columns and one to show the average of values in the columns. I can quite easily calculate these values by aggregating information taken from the rowDataBound event, but don't know how to go about manually adding the additional two rows to the gridview. Any help much appreciated.
You can use the Footer just like you use Headers in gridview. Another solution is use a query in such way:
query 1 : your original query
UNION
query 2 : your query which contains sum
(This applies only if you don't apply paging to your grid)
If it's a single row of information you can use summary footer. See Displaying Summary Information in the GridView's Footer.
(source: asp.net)
If you want two additional rows, you can stuff rows into an IList. At the business logic layer, you can add more rows to the list returned by DAL.

Resources