473,320 Members | 1,854 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,320 software developers and data experts.

Customize a header in DataGrid

Hi,

I'd like to customize a header in a DataGrid. I want to add a link in the
header, as well as pull a recordset's ID. I am using a TemplateColumn so
that I can hold several lines of information in one column. The header is
now called General Information, I'd like to add an Edit, linked to another
page referencing the selected record's ID from a request. And because it is
a templatecolumn, I cannot use the built-in edit with DataGrid.

Thanks!

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com

Nov 18 '05 #1
1 1180
create your on header. handle the DataGrid_ItemCreated event and in that add
your custom controls in the header.

private void yourDataGrid_ItemCreated(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Header)
{
DataGridItem dgi = (DataGridItem)e.Item;
dgi.Cells[0].Controls.Add(new TextBox()) // your control/s goes here
}
}

also see
http://www.extremeexperts.com/Net/Ar...gDataGrid.aspx

Senthil

"David Lozzi" wrote:
Hi,

I'd like to customize a header in a DataGrid. I want to add a link in the
header, as well as pull a recordset's ID. I am using a TemplateColumn so
that I can hold several lines of information in one column. The header is
now called General Information, I'd like to add an Edit, linked to another
page referencing the selected record's ID from a request. And because it is
a templatecolumn, I cannot use the built-in edit with DataGrid.

Thanks!

--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com

Nov 18 '05 #2

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

Similar topics

0
by: Maria | last post by:
Hi I am new to .NET and would like to know how do we customize the apprearance of a datagrid Precisely, I would like to make ONE row appear in BOLD, and I would like to specify the number of...
2
by: Hai Ly Hoang | last post by:
Hi, Datagrid is a great control ! But now, i want to customize it : draw a picture on the header row (the topmost row) ! Is it possible ? And how ? Thanks
1
by: James Lennon | last post by:
How can I customize a DataGrid row based on the row properties. For istance if a column is 0 make the row bold or red. I have only been able to format a datagrid based on columns. James
1
by: Amy Snyder | last post by:
I have a datagrid where I incorporate paging and sorting. My datagrid page mode is set to numeric. Is there a way for me to customize this to display something like this in the page header: ...
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: Ray | last post by:
I am trying to add a "Next >" and "<Prev" button to the pager of my datagrid. I have been able to add the hyperlinks to the pager. I am now trying to determine the correct postback script to...
0
by: Mitkip | last post by:
Does someone know how can I make a user control which allow me to customize it like a datagrid or a repeater ... For example, I would like to call my control in an aspx page like this : <%@...
4
by: Grace | last post by:
I use a datagrid included in a repeater. as following: (.aspx) <asp:repeater id="rp_perform" Runat="server"> <HeaderTemplate> <table border="0" bgcolor="gray" cellspacing="0" cellpadding="0">...
4
by: Fred | last post by:
Hello, datagrids have GridLines, BorderWidth, BorderColor, ItemStyle.CssClass, ShowFooter ... properties, which can be used to customize the way they look when printed, how does one achieve the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
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...
0
isladogs
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 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.