Hi all,
Is it possible to create subheaders in datagrids? Or rather to add a parent
header row to an existing datagrid? Currently my DG looks like this:
NAME | A - PART1 | A - PART2 | A - PART3 | B - PART1 | B - PART2
whereas id like it to look like:
NAME | A | B |
|PART1 | PART2 | PART3| PART1 | PART2|
or
| A | B
|
NAME |PART1 | PART2 | PART3| PART1 | PART2|
Im trying to intercept the databind event and checking for item type =
header, but am getting a bit stuck after that. IS that the correct approach,
or is there another way?
Thanks!
Spammy 4 2142
Something like this will work:
Private Sub GrdName_PreRender(ByVal sender As Object, ByVal e As
System.EventArgs) Handles GrdName.PreRender
'Add header to datagrid
Dim dgitem As New DataGridItem(0, 0, ListItemType.Header)
Dim mycell As New TableCell
mycell.Text = ""
mycell.BackColor = Color.White
dgitem.Cells.Add(mycell)
GrdName.Controls(0).Controls.AddAt(0, dgitem)
End Sub
-John Oakes
"spammy" <me@privacy.net> wrote in message
news:2i************@uni-berlin.de... Hi all,
Is it possible to create subheaders in datagrids? Or rather to add a
parent header row to an existing datagrid? Currently my DG looks like this:
NAME | A - PART1 | A - PART2 | A - PART3 | B - PART1 | B - PART2
whereas id like it to look like:
NAME | A | B | |PART1 | PART2 | PART3| PART1 | PART2|
or
| A | B | NAME |PART1 | PART2 | PART3| PART1 | PART2|
Im trying to intercept the databind event and checking for item type = header, but am getting a bit stuck after that. IS that the correct
approach, or is there another way?
Thanks!
Spammy
john,
that worked great - thanks!
a few things - tablecell.columnspan allows you to set how "wide" the header
row will be and it may be a better idea to use the tableheadercell rather
than the normal tablecell.
spammy
"John Oakes" <jo**@nospam.networkproductions.net> wrote in message
news:OA**************@TK2MSFTNGP11.phx.gbl... Something like this will work:
Private Sub GrdName_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles GrdName.PreRender 'Add header to datagrid Dim dgitem As New DataGridItem(0, 0, ListItemType.Header) Dim mycell As New TableCell mycell.Text = "" mycell.BackColor = Color.White dgitem.Cells.Add(mycell) GrdName.Controls(0).Controls.AddAt(0, dgitem) End Sub
-John Oakes
"spammy" <me@privacy.net> wrote in message news:2i************@uni-berlin.de... Hi all,
Is it possible to create subheaders in datagrids? Or rather to add a parent header row to an existing datagrid? Currently my DG looks like this:
NAME | A - PART1 | A - PART2 | A - PART3 | B - PART1 | B - PART2
whereas id like it to look like:
NAME | A | B
| |PART1 | PART2 | PART3| PART1 | PART2|
or
| A | B | NAME |PART1 | PART2 | PART3| PART1 | PART2|
Im trying to intercept the databind event and checking for item type = header, but am getting a bit stuck after that. IS that the correct approach, or is there another way?
Thanks!
Spammy
Thanks. I do use columnspan and tableheadercell depending on the situation.
I was just giving a very simple example for demonstration purposes. Glad it
helped!
-John Oakes
"spammy" <me@privacy.net> wrote in message
news:2i************@uni-berlin.de... john,
that worked great - thanks!
a few things - tablecell.columnspan allows you to set how "wide" the
header row will be and it may be a better idea to use the tableheadercell rather than the normal tablecell.
spammy
"John Oakes" <jo**@nospam.networkproductions.net> wrote in message news:OA**************@TK2MSFTNGP11.phx.gbl... Something like this will work:
Private Sub GrdName_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles GrdName.PreRender 'Add header to datagrid Dim dgitem As New DataGridItem(0, 0, ListItemType.Header) Dim mycell As New TableCell mycell.Text = "" mycell.BackColor = Color.White dgitem.Cells.Add(mycell) GrdName.Controls(0).Controls.AddAt(0, dgitem) End Sub
-John Oakes
"spammy" <me@privacy.net> wrote in message news:2i************@uni-berlin.de... Hi all,
Is it possible to create subheaders in datagrids? Or rather to add a parent header row to an existing datagrid? Currently my DG looks like this:
NAME | A - PART1 | A - PART2 | A - PART3 | B - PART1 | B - PART2
whereas id like it to look like:
NAME | A | B | |PART1 | PART2 | PART3| PART1 | PART2|
or
| A | B | NAME |PART1 | PART2 | PART3| PART1 | PART2|
Im trying to intercept the databind event and checking for item type = header, but am getting a bit stuck after that. IS that the correct approach, or is there another way?
Thanks!
Spammy
oh - i posted that for group archive purposes just in case anyone else did a
search. i didnt doubt that you knew what what going on!
Spammy
"John Oakes" <jo**@nospam.networkproductions.net> wrote in message
news:ei**************@TK2MSFTNGP12.phx.gbl... Thanks. I do use columnspan and tableheadercell depending on the
situation. I was just giving a very simple example for demonstration purposes. Glad
it helped!
-John Oakes
"spammy" <me@privacy.net> wrote in message news:2i************@uni-berlin.de... john,
that worked great - thanks!
a few things - tablecell.columnspan allows you to set how "wide" the header row will be and it may be a better idea to use the tableheadercell
rather than the normal tablecell.
spammy
"John Oakes" <jo**@nospam.networkproductions.net> wrote in message news:OA**************@TK2MSFTNGP11.phx.gbl... Something like this will work:
Private Sub GrdName_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles GrdName.PreRender 'Add header to datagrid Dim dgitem As New DataGridItem(0, 0, ListItemType.Header) Dim mycell As New TableCell mycell.Text = "" mycell.BackColor = Color.White dgitem.Cells.Add(mycell) GrdName.Controls(0).Controls.AddAt(0, dgitem) End Sub
-John Oakes
"spammy" <me@privacy.net> wrote in message news:2i************@uni-berlin.de... > Hi all, > > Is it possible to create subheaders in datagrids? Or rather to add a parent > header row to an existing datagrid? Currently my DG looks like this: > > NAME | A - PART1 | A - PART2 | A - PART3 | B - PART1 | B - PART2 > > whereas id like it to look like: > > NAME | A | B | > |PART1 | PART2 | PART3| PART1 | PART2| > > or > > | A | B > | > NAME |PART1 | PART2 | PART3| PART1 | PART2| > > Im trying to intercept the databind event and checking for item type
= > header, but am getting a bit stuck after that. IS that the correct approach, > or is there another way? > > Thanks! > > Spammy > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ashish Shridharan |
last post by:
Hi All
I have been trying to add a control to the header cell of
a datagrid on my ASP.NET page. These controls are defined
in the HTML as ASP.NET web controls.
They are being added into the...
|
by: Bill C. |
last post by:
Hello,
I know this has been discussed a lot already because I've been searching
around for information the last few weeks.
I'm trying to implement a DataGridComboBoxColumn class. I've found...
|
by: BBFrost |
last post by:
Win2000
..Net 1.1 SP1
c# using Visual Studio
Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1
datagrid.
I've come to realize that a 'block' of rows highlighted within...
|
by: pei_world |
last post by:
I want to implement a key hit with enter to dropdown a combobox that is in
the datagrid. in this case I need to override its original behaviours. I
found some codes from the web. Does anyone know...
|
by: Rick |
last post by:
Hello all, I hope all is well with you.
I am having a seriously difficult time with this problem. Allow me to
set
up the problem.
I have a System.Web.UI.Page with the following controls...
|
by: CSL |
last post by:
I am using the DataGrid in a Windows Application, how can
I adjust the widths of each column individually.
|
by: Dave |
last post by:
Are there any add-on products or samples available that can do the following
in an vb.net datagrid
I want to compare 2 rows in a datagrid - one row from one database and
another row for another...
|
by: igotyourdotnet |
last post by:
I'm using a gridview and I have it formatted using sub headings. now I need
to get totals for each sub heading. Is this possible?
example:
BMW (sub heading) 25,000
14,252
25,000
total:...
|
by: igotyourdotnet |
last post by:
I have a gridview were i'm using subheaders, but now I want to add totals
for each 'subheader'.
First, is that possible to do, and second, can someone point me to an
example how this works?
My...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
| |