473,398 Members | 2,368 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,398 software developers and data experts.

copy a template column

This sounds complicated but bear with me. I have a datagrid. It is dynamic in
that, i dont know how many columns i will have until the dataset is back so i
have to build the datagrid dynamically. I know there will be at least one
column required however, so I have put into my aspx a template column with a
checkbox in it. Then for the number of columns in my dataset more than 1 I
want to copy that templatecolumn and duplicate it for the amount of columns
remaining in the dataset. all columns have the same checkbox in it and is
identical to the one I have written in the aspx, but the column headertext is
diff etc. the reason i do it this way is because i need to put an event in
the oncheck of the tickbox and i cannot easily dynamically set this in server
code (has to initialise before databind etc believe me i've tried).

e.g. my dataset returns 5 columns. i bind the first column to my datagrid
column 1. Then I want to duplicate this templatecolumn x 4 grabbing values of
the corresponding dataset column as I go. Does that make sense?

I cant find a way to copy a template column, and all of its child controls.

any help appreciated. thanks.
Nov 19 '05 #1
1 1438
Hi Louise,

You can inherit from ITemplate to create your own customized
DataGridTemplate. This example has a demonstration of how to create a
customized template for the DataGrid:
http://www.societopia.net/Samples/Da...Delegates.aspx

HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"louise raisbeck" wrote:
This sounds complicated but bear with me. I have a datagrid. It is dynamic in
that, i dont know how many columns i will have until the dataset is back so i
have to build the datagrid dynamically. I know there will be at least one
column required however, so I have put into my aspx a template column with a
checkbox in it. Then for the number of columns in my dataset more than 1 I
want to copy that templatecolumn and duplicate it for the amount of columns
remaining in the dataset. all columns have the same checkbox in it and is
identical to the one I have written in the aspx, but the column headertext is
diff etc. the reason i do it this way is because i need to put an event in
the oncheck of the tickbox and i cannot easily dynamically set this in server
code (has to initialise before databind etc believe me i've tried).

e.g. my dataset returns 5 columns. i bind the first column to my datagrid
column 1. Then I want to duplicate this templatecolumn x 4 grabbing values of
the corresponding dataset column as I go. Does that make sense?

I cant find a way to copy a template column, and all of its child controls.

any help appreciated. thanks.

Nov 19 '05 #2

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

Similar topics

4
by: franky.backeljauw | last post by:
Hello, I have a problem with using a copy constructor to convert an object of a templated class to object of another templated class. Let me first include the code (my question is below): ...
2
by: Anna | last post by:
Hi all. I am trying to write a stylesheet that will structure the input HTML file in the following way: For each heading of level n it needs to enclose the heading and all its content until the...
1
by: Rolf Kemper | last post by:
Dear Experts, I'm going to create an Excell spreadsheet xml. So far things work very well. But in case I add <Row> elements by a recursive template call it goes wrong. See the attached XSLT...
3
by: Martin Vorbrodt | last post by:
In "C++ Templates, The Complete Guide" i read that template copy-con is never default copy constructor, and template assignment-op is never a copy assignment operator. Could someone please explain...
2
by: damonf | last post by:
I'm currently trying to add an ASP hyperlink to a template column in a datagrid. The normal hyperlink column doesn't give me the ability to add attributes to the item. In my grid there are four...
1
by: William Gower | last post by:
I need to develop a datagrid that uses columns from a table. In addition I need two columns (checkboxes) that the user will use to indicate that this record can be closed later. The checkboxed...
3
by: danilo.horta | last post by:
Hi guys I'm trying to accomplish a slightly difficult task. I think it's more easy to explain trought an unworking code: template<class T, size_t numDim> VecBasis {/*...*/}; typedef...
11
by: Nindi73 | last post by:
A few days a ago I posted my code for a deep copy pointer which doesn't require the pointee object to have a virtual copy constructor. I need help with checking that it was exception safe and...
6
by: Peng Yu | last post by:
Hi, I'm wondering if the following assignment is lazy copy or not? Thanks, Peng std::vector<intv. v.push_back(1); v.push_back(2);
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
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...
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
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.