473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Addin A Row To Datagrid Header

Hello, I am trying to figure out how to add an extra row
of heading to my datagrid. I came up with the following
code:

Public Sub dgNewMovies_ItemCreated(ByVal sender As
Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgNewMovies.ItemCreated

If e.Item.ItemType = ListItemType.Header Then
Dim Item As DataGridItem
Dim ItemCell As TableCell
Item = New DataGridItem(0, 0,
ListItemType.Header)
ItemCell = New TableCell()
ItemCell.ColumnSpan = 7
Item.Cells.Add(ItemCell)
ItemCell.Text = "Add Movies And Tapes
DataEntry"
dgNewMovies.Controls(0).Controls.AddAt(0,
Item)
End If

End Sub

It runs through the code, but no additional heading - I
still have my original headings. Any idea what I am
doing wrong?
Nov 18 '05 #1
4 995
Check out this article,
http://www.extremeexperts.com/Net/Ar...gdatagrid.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Jim Heavey" <Ji*******@nospam.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
Hello, I am trying to figure out how to add an extra row
of heading to my datagrid. I came up with the following
code:

Public Sub dgNewMovies_ItemCreated(ByVal sender As
Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgNewMovies.ItemCreated

If e.Item.ItemType = ListItemType.Header Then
Dim Item As DataGridItem
Dim ItemCell As TableCell
Item = New DataGridItem(0, 0,
ListItemType.Header)
ItemCell = New TableCell()
ItemCell.ColumnSpan = 7
Item.Cells.Add(ItemCell)
ItemCell.Text = "Add Movies And Tapes
DataEntry"
dgNewMovies.Controls(0).Controls.AddAt(0,
Item)
End If

End Sub

It runs through the code, but no additional heading - I
still have my original headings. Any idea what I am
doing wrong?

Nov 18 '05 #2
"Saravana [MVP]" <sa******@sct.co.in.nospam> wrote in news:eFMUaTlrDHA.1760
@TK2MSFTNGP10.phx.gbl:
http://www.extremeexperts.com/Net/Ar...gdatagrid.aspx


Yes, that was the article that I was using to create my header, but I have
not been able to get it to work.
Nov 18 '05 #3
Can you send your full code, so that i can look into that.

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Jim Heavey" <Ji*******@nospam.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
"Saravana [MVP]" <sa******@sct.co.in.nospam> wrote in news:eFMUaTlrDHA.1760 @TK2MSFTNGP10.phx.gbl:
http://www.extremeexperts.com/Net/Ar...gdatagrid.aspx


Yes, that was the article that I was using to create my header, but I have
not been able to get it to work.

Nov 18 '05 #4
I got it to work, I don't know what I was doing wrong. I was guessing that
it might have to do with the fact that I was using headertemplates, but
that did not turn out to be the case.

Thanks for "sticking" with the issue!!!!!!!!
Nov 18 '05 #5

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

Similar topics

8
by: Jaime Rios | last post by:
Hi, I created a COM AddIn for Word that performs the functions that it needs to, but I needed to add the ability for the toolbar created by the COM AddIn to remember it's last position and...
7
by: Matthew Wieder | last post by:
Hi - I have a datagrid that has a black header and the rows alternate white and gray. The problem is that until items are added to the grid, the grid appears as a large black rectangle, which is...
4
by: sumit | last post by:
Hi, I want to make a datagrid to be scrollable instead of paging in it. So i have put that datagrid html tags inside <div></div> tags and made that div scrollable. Due to this if i scroll down...
3
by: Ben | last post by:
Hi, I'm wondering how can i change the datagrid header text at runtime so that it keeps the sorting enabled? I can do; e.Item.Cells.Text = "foo"; But then foo is the text of the table cell...
0
by: Daniel Doyle | last post by:
Hello and apologies in advance for the amount of code in this post. I've also sent this message to the Sharepoint group, but thought that ASP.NET developers may also be able to help, even though...
0
by: guilligan.geo | last post by:
Hello, I'm trying to create an addin for Outlook 2002 using the one provided in the demo of win32com as a starting point. I've been able to do my addin and test it if I go the "standard" way...
7
by: Joseph Geretz | last post by:
I've been working on an Addin for Outlook in C#. It hasn't been long now, just a couple of days. Suddenly though, running my project in Debug launches Outlook as specified, but no breakpoints...
2
by: Santosh | last post by:
Dear all i want to bind data to datagrid header template i am wrtting follwing code it is displaying data with in item template not but it is display data in header template <asp:DataGrid...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
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...
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.