473,512 Members | 15,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic Header in GridView

DJE
Is it possible to make the header of a gridview contain data from the
grid? I have nested gridviews and in the Child gridview I want the
column heading to be "Email To Tom" for Parent Row1, "Email To Dick"
for the Child grid in Parent Row2, "Email To Harry" for the Child
grid in ParentRow3, etc...where "Tom", "Dick" and "Harry" all come
from the datagrid or datasource. It seems like I need to know the
values before they are available.

Dec 4 '07 #1
1 4758
Hi,

I don't remember the exact procedure at the moment, but I believe you should
be able to do this using an event, possibly DataGridView.RowEnter. Try
trapping this event, and set the header using the CurrentRow data.

--
Happy Coding!
Morten Wennevik [C# MVP]
"DJE" wrote:
Is it possible to make the header of a gridview contain data from the
grid? I have nested gridviews and in the Child gridview I want the
column heading to be "Email To Tom" for Parent Row1, "Email To Dick"
for the Child grid in Parent Row2, "Email To Harry" for the Child
grid in ParentRow3, etc...where "Tom", "Dick" and "Harry" all come
from the datagrid or datasource. It seems like I need to know the
values before they are available.

Dec 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1585
by: Mark Parter | last post by:
I'm adding a dynamic column to a gridview control at runtime but I'm encountering a problem whereby I can only add 1 item to the column header. The column header should show the date in the...
3
13725
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
4
8313
by: Ken Wigle | last post by:
All, I would be very grateful for any help on this question. I have an application in asp.net 2.0 where I dynamically create a datatable and then bind that to a gridview. Unfortunately, the...
2
16972
by: =?Utf-8?B?dmFuZGls?= | last post by:
I have a web app that I have been working on for the last couple of weeks trying to solve this problem. One page contains a GridView with four base columns, and an unknown number of columns to be...
0
1109
by: palgre | last post by:
HI All, I want to disply dynamic Columns and Dynamic Header to that column in a GRID VIEW. The application is kind of TimeSheet for entering weekly hrs for a month. 1. First of all I want to...
5
1957
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I have a sub in vb.net that adds extra headers to a gridview and it works very well. however, i tried to translate it to c# and i'm getting the header inserting itself over the first datarows and...
7
12943
by: rote | last post by:
I would like to make my Gridview header dynmic i.e databinded from database.. I want my users to be able to change the headers on the fly.. Any ideas?
9
11879
by: lilOlMe | last post by:
Hi there! I have generated a GridView that looks something like: SportName| CompanyNameX |CompanyNameY |CompanyNameZ Hockey.....| Shipping------------ |Accounting-------- |Shipping------------...
3
13976
Frinavale
by: Frinavale | last post by:
I have implemented the ITemplate interface to dynamically "display" complicated data in a GridView. For the life of me I cannot implement the template in such a way that when it is applied to...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.