how to put column values as column headers in datagrid

Hi,

I am trying to develop a report. Basically we have two tables named A and B.
In Table A we have columns
DelivTypeId
EstDate
CompDate
In Table B we have columns
DelivTypeId
DelivDesc
I have written a join select statement to get the DelivDesc, StartDate, Enddate
so the result would be like
DelivDesc StartDate EndDate
Tiering1 8/31/2004 9/20/2004
Tiering2 8/31/2004 9/20/2004
Tiering3 8/31/2004 9/20/2004
Tiering4 8/31/2004 9/20/2004
I need my datagrid look like this
Tiering1 Tiering 2 Tiering 3 Tiering 4
Completed Completed Completed Completed

I need to put the column values as column labels and I need to check whether the completed date is less than the current date. if so i need to place "Completed" in that column.
Can you please let me know how to do this? Do I need to change my Select Statement or can i access multiple rows inside my datagrid?
Thanks,
Sridhar!!
0
dsridhar10
10/18/2004 3:31:24 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

0 Replies
622 Views

Similar Articles

[PageSpeed] 16

Reply:

Similar Artilces:

column header to span two columns in a datagrid display
Is it possible for a column header to span two columns? If so how would this be done? Thanks In the ItemDataBound (or ItemCreated) check if Item is of type Header and if so - define the colspan property of the Cell object which you want to define the Colspan for and delete the next Cell from hte DataGridItem CheersBug [MCSD] Is it possible to span header column in design view only. using some kind of CSS. I'm using ASP,NET 3.5 and GridView...

Making hyperlink on one column in datagrid from values in other column
Dear friends,  I have columns in database: id, homepage (stores url of persons hompage), name. I want to display in datagrid in such a way that: Only name as hyperlink (hyperlink value to be retrieved from id value, so that direct link will not be available) will appear in datagrid. So, that when user will click on hyperlinked email, it should get redirect to homepage url i.e.<a href=redirect.aspx?id=1>John></a> Only john should appear in gridview and will be redirected to is homepage say www.xyz.com/john   Thanks If u mean, how to place the I...

Adding a image in a column of datagrid depending upon the other column value
hi     i have a dataset which returns few columns from a table, one of the let say "RTW" this column has combination of null and other values.now i am setting my datagrids  datasource property to this dataset.upto here everything is fine, the problem is i have to add a column to the datagrid and display an image when the  "RTW" column value  is not null.for null values it shouldnt display anything.ThanksChandra This should be fairly simple, all you need to do is wire up the ItemDataBound event of datagrid.  Once you've done this make sure that e...

Retrieving DataGrid Column values in Edit Mode with Hidden Column
Hi Folks, Is it possible to retrieve the values from a DataGrid column while in Edit mode if the column is hidden? I'd like to get these values in the Update event handler. If this is possible could someone tell me how to do it? Thanks, Rick You can get those values in several ways, but not directly from the datagrid. During the Update command you can do those things: 1. Look for the value in the associated dataset if you've used a dataset to bind to the grid. 2. Query the database for the current record and get the appropriate data right from the query result. Ca...

Datagrid Bound Column needs to be bound to 2 columns?a valu
Hi I have a datagrid with dynamically bounded columns. One column has to display a value that will come from 2 columns in the database. Is there a way to do this? the code I have for the moment is: 'Add columns 'Code Dim col1 As New BoundColumn col1.HeaderText = cLang.read("code") col1.DataField = "Patient_Code" 'this needs to be 2 database columns!! dtaSearchresult.Columns.Add(col1) .. .. .. .. Thx alot! Combine the two columns in your SELECT statement eg SELECT <PatientCol1>+<PatientCol2> AS Patient_Code FR...

How to retrieve controls in column header of a DataGrid?
I have controls in column header of a my DataGrid control grdDocumentDate. I use grdDocumentDate.FindControl() to look for the controls in column header but could not get them. Is there any way to solve the problem? ImageButton ib = (ImageButton)grdDocumentDate.FindControl("ibDocDate");ib always returns null.<asp:datagrid id="grdDocumentDate" style="Z-INDEX: 118; LEFT: 24px; POSITION: absolute; TOP: 176px" runat="server" BorderWidth="0px" AllowSorting="True" AutoGenerateColumns="False" OnItemCommand="ShowMoreDetailsCommand" BackColor="Silver"    Width="704px"> ...

When is a column not a column?
I have several extremely similar datawindows that I have to maintain that go against the same table. Recently, I had to add a column to that table, and also add the column to ALL of these datawindows that go against this table. I added the column to the first datawindow, set up the edit control style, etc. I then did a copy/paste of the columns edit control to the remaining dw's (of course remembering to first add the column in SQL). Everything (update props, column specs, column props) seems to indicate that the pasted column is linked to the column I selected, HOWEVER, when I...

How to place in DataGrids’s first column table’s column name, in second Datagrid’s column table’s column value?
Hello I use C#. I’m interesting are there samples solved my problem. Andrew. You will need to loop through the datasource of the datagrid or through the datagrid items and fetch the values for the second datagrid.Sonu Kapoor [MVP] Feel free to ask me any .NET question | Ajax Data Controls Forum Thank you! I solved my problem at the server cite. Andrew. ...

Setting Datagrid Column to invisible when Column is an AutoGeneratedColumn NOT a bound Column
Hi all, Just like the title says, I'm trying to set a column to invisible but I'm unable to do so. If I bound the column I can used the code: me.datagrid.Column.Item(1).Visible = False But since I'm wanting the column NOT to be bound (there are a number of sql scripts that populate the same datagrid so I cannot bound all the columns since the columns are different for each script etc etc etc) how do I set an AutoGeneratedColumn to invisible?? Please help! Andrewwww.codingmayhem.com - VB.NET, C#, Silverlight, Javascript, HTML, CSS, T-SQL, MySQL and SQLitewww.headshot...

putting images into datagrid based on column value
Been looking all over the place, but can't figure this one out yet: I'm trying to put an image into a datagrid based on the value of a column. I.E. if the column's value is "1", show image 1; if "2", show image 2, etc. If the column's value is "1", I don't want to put an image there at all. On top of this, I need to attach an 'onclick' event to the cells with images. When I converted my datagrid column to a template column, I was able to successfully add an html image and got the correct images to show and the onclick events to work. Unfortunately, a b...

Can you control selectability of DataGrid column headers?
We have a DataTable with sorting enabled.  The person that I am working for has a complaint:  he wants the user to be able to select a column for sorting whenever the mouse is over the text in the header text of the column;  as things stand now, the cursor must be positioned  just below the text before the browser will allow selection.  Is there a way to control this, or  is this functionality that is internal to the browser? This behavior appears to only be an issue in Internet Explorer, not Firefox. the sort headers are simply an anchor...

Get the column value from a DataGrid
 Hi,I have a datagrid with 6 columns. I am trying to retrieve the value of a column and pass it to a variable. I am not sure what I doing wrong here since the code I am using is not pulling any value from the column.  This is an example of what I am trying to do. Dim column_value As Stringcolumn_value = DataGrid1.Items(0).Cells.Item(4).Text                        Please correct me if I am wrong.   Thanks.    Use a GridView control instea...

Changing Datagrid Header based on column value
I am trying to change the header text of a column based on the values in the rows them selves. Basically if and of the values in the columns are 0 I want to change the text of the header. I was trying to do this during the databound event, but the problems I was having was that I could not access the headertext of the column from the DataGridItemEventArg parameter. I did get access to the Grid itself (they nested in a repeater btw) by accessing e.Item.Parent.Parent, but changes to the HeaderText were not displayed. Any help would be appreciated, Thanks Show the relevant code ...

Using Headers spannig multiple columns & aspbound columns together in the same datagrid
I am trying to format a datagrid to display my data. I have some headers that span multiple columns. I was able to implement this using the following code structure. <Columns> <asp:TemplateColumn> <HeaderTemplate> <tr> <td rowspan="2" colspan="1" width="40%">Model</td> <td rowspan="1" colspan="4">Sales</td> <td rowspan="2" colspan="1">Distribution</td> <td rowspan="2" colspan="1"...

Web resources about - how to put column values as column headers in datagrid - asp.net.presentation-controls

Want to preview our new DataGrid for Xamarin.Forms?
tl;dr Zumero.DataGrid is a Xamarin.Forms control for displaying data in rows and columns. If you would be interested in testing and previewing ...

Mad King DataGrid
This post is about scrolling in WPF and the egocentric DataGrid control. I’ll give the project background but if all you’re interested in is ...

Stack Overflow
Stack Exchange log in - careers - chat - meta - about - faq Questions Tags Users Badges Unanswered Ask Question Top Questions interesting 295 ...

Microsoft Silverlight - Wikipedia, the free encyclopedia
Microsoft Silverlight is an application framework for writing and running rich Internet applications , with features and purposes similar to ...

Flash Builder Plug-in for SAP Netweaver Gateway - Adobe Labs
Search Navigation Labs Home Wiki Home Technologies Alchemy Blueprint Camera Profiles and DNG Profile Editor Cirrus ColdFusion 10 DNG Codec Fireworks ...

Casaba Security » Products » X5s Testing Tool For Finding XSS Vulnerabilities
Security analysis, consulting, development and testing partners who understand your business strategy.

CodeGuru - Microsoft developers related ideas, articles, tips, tricks, comments, downloads, and so much ...
CodeGuru is where developers can come to share ideas, articles, questions, answers, tips, tricks, comments, downloads, and so much more related ...

Caliburn Micro: WPF, Silverlight, WP7 and WinRT/Metro made easy.
A small, yet powerful framework designed for WPF, Silverlight and WP7. It implements a variety of UI patterns for solving real-world problems. ...

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 11 Jul 2012

license-discuss@opensource.org: 11636: first draft of license proliferation committee report
FYI,the first draft report of the OSI's License Proliferation Committee.To join the OSI's license proliferation discuss email list, send anemail ...

Resources last updated: 11/28/2015 9:27:32 PM