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

Do I need to use a template column in this case?

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 column is not a field in the
table. It is just for the purposes of the Datagrid and I do not need to
store whether it was checked or not. Do I use a Template Column for this?
Nov 18 '05 #1
1 1290
Hi
To answer your first question, if your going to use a checkbox column in your datagrid, there is no other way than a template column, without getting real low level and dynamically adding a column to the allready substantiated grid
I have a question though
If you are not going to store the checkbox checked value how will it be useful
The datagrid relies on state and all will be well and good as long as the user does not close the browser. Closing the browser will of course destroy the state and clear the boxes

As far as creating the template column just left click on the datagrid, add a bound column and name it, click the link at the bottom of the properties page that says convert to template column, left click on the datagrid again, select edit template and then your template column name from the context menu the mouseover produces, and drag a checkbox from the toolbox to the item section

If you dont have visual studio and your doing it by hand then your HTML code will should like thi

<asp:DataGrid id="DataGrid1" runat="server" AutoGenerateColumns="false"><Columns><asp:Template Column HeaderText="MyCheckBoxColumn"><ItemTemplate><asp:C heckBox id="MyCheckBox" runat="server"></asp:CheckBox></ItemTemplate><EditTemplate><asp:TextBox id="MyTextBox" runat="server"></asp:TextBox></EditTemplate></asp:TemplateColumn></Columns></asp:DataGrid

Hope That Help
Harold
Nov 18 '05 #2

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

Similar topics

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...
0
by: CoreyMas | last post by:
Hello Everyone, I have been successful in creating a template column programatically using the examples provided in VS 2003. However I have not been able to programatically set the width of a...
0
by: MattB | last post by:
I got a response earlier, but I thought I'd bump this one to the top for a quick answer. Any tips, suggestions, or especially examples would be great! It seems like I may be able to do this...
2
by: Patrick Delifer | last post by:
Hi, I am trying to implement a JS confirm dialog when a user is deleting something off my Datagrid. The problem is that I don't have a Delete button in which case I could write the following...
8
by: Larry Coon | last post by:
I'm trying to use xsl for the first time, and as with any first-time attempt, I'm running into problems. I'm trying to transform an XML document into another XML document with a slightly...
1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
2
by: Smokey Grindle | last post by:
I have the following on my page... a link button that will send the command name "use" to the command handler and a grid view with the following columns 0 - Template column - just a checkbox...
0
by: imranabdulaziz | last post by:
Hi all, I am using asp.net and C# Visual studio 2005. Let me explain the scenario. I have stored procedure which return very no of column based on condition. Becoz I have to show columnwise...
3
by: djsuson | last post by:
I'm trying to set up an inheritance tree that also uses templates. This is an attempt to simplify some previous code that was filled with redundancies. I'm working with g++ 3.4.6. The code is split...
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...
0
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,...
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: 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
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...

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.