Sql Server - Gridview Highlight Max Values In Multiple Columns?

Mar 29, 2011

I have a gridview that shows, for example, a baseball team's statistics. It's a standard sports stats grid - the rows show statistics for each player and the columns show the specific stat for the each player.

Easy enough so far. But what I would then like to do is style (highlight or bold) the Max or Min (the team leader) of each stat column. For example, Player A may only lead in one or two categories, so we cannot style the entire row. If Player A just leads the team in strikeouts, I just want to style the number of strikeouts he had (THAT cell only).

What's the best way to handle this? Make SQL Server do all the work and in effect, rank EVERY stat of each player, effectively doubling the number of columns (e.g. col: AB, col: ABRank). Or do I let the rowdatabound event of the gridview handle this?

If I chose the latter, I think I would get the Max of every statistical category from the datatable before binding (e.g. store them in a local variable) then on rowdatabound, if they match the value, apply the style.

View 3 Replies


Similar Messages:

Forms Data Controls :: Adding All The Values In Multiple Columns In A Gridview?

May 14, 2010

I'm just wondering if anyone can assist me with this gridview problem

I have this Sql statement that outputs a gridview like this

Job Location Activity 1 Activity 2 Activity 3

Job1 Location1 0 0 1

Job2 Location2 1 0 1

Job3 Location3 0 1 0

* These columns are placeholders

I want to include a footer total that looks like

Job Location Activity 1 Activity 2 Activity 3

Job1 Location1 0 0 1

Job2 Location2 1 0 1

Job3 Location3 0 1 0

Final Total 4

Im not binding the database to the gridview via design view I'm binding it programatically in the default.aspx.cs file

So far the only tutorials I've encountered are ones the have the database bound through design view and gridviews with only one column that can be added. In my particular example I have multiple columns that need to be added and I have already bound the data to the gridview.

View 6 Replies

Data Controls :: Make Columns Hidden In GridView And Access Their Values Server Side

Feb 24, 2014

I want to get the values from the Invisible rows from my gridview.  here is my code.

<asp:GridView ID="gvTeam" runat="server" Width="900px"
AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966"
BorderStyle="None" BorderWidth="1px" CellPadding="4">
<Columns>
<asp:BoundField DataField="FULLNAME" HeaderText="NAME" />
<asp:ButtonField DataTextField="EVALUATION" HeaderText="EVALUATION"
Text="EVALUATION" CommandName="select" >

[Code]...

View 1 Replies

Forms Data Controls :: Webform - Highlight Two Columns In Excel Category - Weight And Then Past Them From Clipboard To Gridview

Mar 23, 2011

I have a gridview that has the following colums Category, Weight , and an option to delete row. I user would like to be able to highlight two columns in excel Category, Weight and then past them from clipboard to gridview.

View 1 Replies

Forms Data Controls :: Highlight Duplicate Values In Gridview?

Feb 18, 2011

The user will enter values in the textbox of the gridview in item template. A button outside the grid, when it is pressed we have to highlight the duplicate values.

Is there is any way to use validation control.

View 2 Replies

DataSource Controls :: Set Up SQL Table Columns To Have Multiple Values?

Mar 9, 2010

Is it possible in to set up an SQL table column to have multiple values? Or would I have to put my values into a new table and link it to the original one?

View 6 Replies

Data Controls :: Filter GridView With Multiple Columns Using Multiple TextBoxes

May 7, 2015

I want search with multiple names in Name coloumn. example I have pass the criteria to Name cloumn is 'Atul', 'Mayur', 'Suraj' this three names how to pass in a query. 

View 1 Replies

Data Controls :: Display Multiple Columns In Multiple Lines In Single Column In GridView

Aug 18, 2015

I have a question in gridview, I want to combine my two or more records into a single cell with two rowsfor Example i have a ID, Name, Year Start, and Year End for Column name in database and i want call it into my gridview that the Year Start and Year End will combine to Year like:

In Database

ID Name Year Start Year End

1 Yourname 2010 2015

In Gridview:

ID Name Year

1 Yourname 2010 2015

in a year column i want it to two row..

View 1 Replies

Data Controls :: Display Multiple Columns In Multiple Lines In Single TemplateField Column In GridView?

Aug 18, 2015

I want to bind three column with one row in gridview in asp.net with c#,

i want like this, 

Name | Info
----------------------
name | lastname

        | phone number

        | address

I get this by default

name | last name | phone number | address 

View 1 Replies

C# - Selected Row Highlight Not Moving When Gridview Is Sorted / Sorts Properly But The Highlight Stays On The Same Line?

Nov 5, 2010

I have an ASP.net gridview on a webform where user's can select a row. When they select it, the row is highlighted yellow. The problem is that when I sort the table, it sorts properly but the highlight stays on the same line. The data all moves, but the highlight stays put.

how I can make the highlight stay with the data?

View 3 Replies

DataSource Controls :: Insert Comma Separated Values Into Multiple Columns Table?

Mar 22, 2010

I've requirement where user can enter multiple columns like first name, lastname, email, age, sex fields and insert them into database.on my frontend aspx page, i'll be showing a single row initially with 5 text boxes(first name, lastname, email, age, sex) and a button to add more columns. when user clicks on add more, another 5 textboxes will be shown and then i'll be taking 5 + 5 (textbox values) and comma seperate them and need to insert into a table with primary auto increment key ID and the remaining 5 columns(firstname, lastname, email, age, sex). I previously worked on the same requirmeent but with only single column. Now i need to insert for 5 columns, How can i do this? Below is my stored proc which i used for single column insertion.

[Code]....

View 12 Replies

Data Controls :: Highlight GridView Rows With Same (matching) Data (values)

Nov 22, 2015

I have a scenario which is the row will be highlighted if that row have the same data.

View 1 Replies

SQL Server :: How To Show Two Columns One Is The One Will Contain The Distinct Values From 'col'

Mar 30, 2011

I have a table 'tbl' and a column 'col'. The elements are like 1,1,2,2,2,3,4,4. Now I want to show two columns one is the one will contain the distinct values from 'col' like 1,2,3,4.... and second will contain the count for each of them like for above case it will be 2,3,1,2.

View 1 Replies

SQL Server :: Search Criteria For Multiple Columns?

Nov 18, 2010

im trying to write a query. for my ui ,i have 3 text boxes for firstname,flightno,sequencenumber.

i input search value on particular textbox it has to be searched on particular column of my db in a single stored procedure.

im using this procedure but it retrives only one column at atime. so like this i need to write three procedures.

but i have only one GO button.

ALTER PROCEDURE [dbo].[spp_searchUsers3]
@lastname nvarchar(50),
@Value varchar(50)
AS
DECLARE @SQL nvarchar(500)
SET @SQL = 'SELECT firstname,flightnumber,lastname,status FROM tbl_pregister WHERE '
+ @lastname + ' LIKE ''%' + @Value + '%'''

View 4 Replies

Javacript With A Gridview / Values Of The Bound Columns?

Apr 14, 2010

I have got a simple gridview two bound columns and one template column with a textbox.

I need to get the values of the bound columns is this possible. I need to times the textbox with the bound column value

Now i can get the textbox value using

// var sumInput = null;
// var tempValue = 0.0;
// var retail = 0.0;
// function Load(sender, args) {
// sumInput = sender;
// }
// function Blur(sender, args) {
// sumInput.set_value(tempValue + (sender.get_value()));
// }
// function Focus(sender, args) {
// tempValue = sumInput.get_value() - (sender.get_value());
// }

View 4 Replies

SQL Server :: Copy Data From Multiple Columns Into One Column?

Aug 26, 2010

My View has four columns with years, none of the rows have complete yearly data.

Current View

Columns 1-10, FY, Expr1, Expr2, Expr3
Some data, 2010 NULL,NULL, NULL
Some data, NULL, 2010, NULL, NULL
Some data, NULL, NULL, 2010, NULL
Some data, NULL, 2010, 2010, 2010
Some data, 2010, NULL, 2010, 2010,
Some data, NULL, NULL, 2010, NULL
Some data, 2010, 2010, NULL, 2010
Some data, NULL, NULL, NULL, 2010

A new column needs to relfect 2010 for each row in the View.

Goal New View
Columns 1-10, FY_NEW
Some data, 2010
Some data, 2010
Some data, 2010, etc. for each row in the view

I can not hard code the data as time moves forward next year rows will have 2012, etc.

How can I get lthe year, in this case 2010, into a new column regardless of the year?

View 10 Replies

SQL Server :: Search Multiple Columns Of Different Datatypes From 1 Parameter?

Nov 11, 2010

We have 2 tables that i need to search thru..we are trying to be as flexible as possible with this search page.. a very stripped down version of how search engines are setup..

You have 1 textbox and are free to enter what ever you want..

Well in our case.. we want to setup a textbox on the page.. and pass that into our procedure and have it look thru 5 differnet columns ( id, date, name, time, number )

So if i enter say 1974 into the field, i want to go find any record that contains that in any of the 5 columns..

Is this possible without using SQL Full text indexing??

View 7 Replies

Forms Data Controls :: Getting Values From The Columns In A Gridview?

Feb 9, 2010

I want to get the values from a cell in a gridview so can I do that without selecting a row. Its something like this I have a drop downmenu and based on the value selected in the dropdown menu I have to change the presentation of gridview without going to the database.

View 3 Replies

C# - Separate Table Column Into Multiple GridView Columns?

Nov 19, 2010

I am retrieving a column from a table using an SqlDataSource in ASP.NET/C#, which contains multiple 'values' separated by commas. I'd like to be able to separate this values into multiple columns in my GridView, and also allow them to update them. Is this easy to accomplish?

View 1 Replies

Web Forms :: Implement Sorting Multiple Columns In GridView

Jul 23, 2012

How to sort grid view rows by multiple column?

View 1 Replies

Data Controls :: GridView Columns Values Must Remain Fix During Edit

Sep 4, 2012

I didnt use bound field here.as it is simple grid view with auto generate columns. I want to make some columns Editable while some should not be editable

<asp:GridView ID="noticeDetails" runat="server" AutoGenerateEditButton="True"
onrowediting="noticeDetails_RowEditing1"
onrowupdated="noticeDetails_RowUpdated1"
onrowupdating="noticeDetails_RowUpdating1"
BorderWidth="1px" Width="100%" CellPadding="10">
</asp:GridView>

View 1 Replies

Data Controls :: GridView - Display Multiple Columns Under One Heading?

May 7, 2015

Gridview code :

<div class="table-responsive">
<asp:UpdatePanel ID="ExistingBuilderGrid_UpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="ExistingBuilderGrid" CssClass="table" EnableViewState="False" AutoGenerateColumns="False"

[Code]....

I want to merger both Fields and both Values column HEADER to one Header cell like Business Assigned Resource ...

NOTE:

dont merge the data cells , only merge header cells

View 1 Replies

Forms Data Controls :: Bind The Values To The Gridview By Sorting 3 Columns

Aug 13, 2010

I have a gridview to which I am binding a database values. My requirement is to bind the values to the gridview by sorting 3 columns as a default sorting with ASC order in one column and descending order in other two.. Can I do it in my .Net code or should I do that in Stored Procedure? If it can be done in .net code Can you tel me how it can be done.

View 2 Replies

Data Controls :: Separate Out And Search Comma Separated Values In Database Columns In SQL Server

Dec 27, 2012

I have one table in sql server called student_info

In this table keys kills column contain value like below

'c,c++c#'
'c++,c,c#'
'c,c++,c#,asp.net'

etc...

I want to search the student information based on keyskills like naukri

1.Any keyskills from textbox1
2.All keyskills from textbox2
3.Except keyskills from textbox3

When I enter c,c++ or c++,c in textbox1 then it will dispaly all the student whose have c,c++ keyskill

How to achieve this.

View 1 Replies

Forms Data Controls :: Gridview Display Multiple Columns Under One Heading

Jun 28, 2010

I want to display my data from sql in a grid view. Here the problem is how do I display more than one columns under one column. For example, I have A, B, C, D, E, F columns in sql and then when displaying in Grid, I want to display as 3 columns A, B, C and under column "B" I want to Display D, E, F.

View 19 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved