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

TOUGH GRIDVIEW PROGRAMMING: Different controls in EditTemplate col

How can I display a different control for my [value_column (varchar)] in my
table, inside an ItemTemplate or EditTemplate, depending on the value of
another column, the [type_column (varchar)], which has values like 'STRING',
'INTEGER', 'BOOLEAN', 'DECIMAL', 'DATETIME', 'MONEY', 'SQL_LIST_VALUES'?

That is, if the [type_column] in a specific gridview row, has a value of
'BOOLEAN', then I want my [value_column] to display a checkbox in
ItemTemplate or EditTemplate and not a textbox. Also, when the [type_column]
is 'INTEGER', I want my [values_column] to display a textbox that accepts
only integer numbers. If the type column is MONEY, I want the ItemTemplate to
display a label formated with the currency symbol. If the [type_column] is
'SQL_LIST_VALUES', the [value_column] should display a dropdownlist in
editmode, filled by a SQL statement stored in a 3rd column [sql_column]. And
so on.

To sum up, when the user sees the gridview in read mode or edit mode, he/she
should see different controls in each row of a specific column and not just
labels or textboxes, which is the default.

TIA
Iordanis
Aug 15 '08 #1
0 870

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

Similar topics

10
by: Nathan Sokalski | last post by:
I have a DataList control with an EditTemplate. Three of the controls in this template include a Calendar, a Button with CommandName="update", and a Button with CommandName="cancel". Whenever I...
2
by: MichaelY | last post by:
Ok...I'm gonna regret this...but here goes....(promise I'm not trolling) After several years of using the provided ASP.NET data display controls (DataGrids, Repeaters, and now the GridView amoung...
1
by: sck10 | last post by:
Hello, I am using the following in a GridView. Currently, I am using a dropdown that pulls the Name of the person, given the Employee ID. I am doing this in both the ItemTemplate and the...
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...
4
by: | last post by:
I wanted better control over the display of the command buttons, so I created Template columns for each command. (Otherwise the GridView was putting extras spacing around the images and such.) ...
1
by: Giovanni | last post by:
Dear Friends/Gurus, I have exhausted myself and have yet no solution to the following: I have an ASP.NET 2.0 Survey type application. On a page, I have placed a GridView which is bound to an...
1
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. ...
0
by: Elmo Watson | last post by:
OK here's the scenario - GridView - populated with Object DataSource - technically no problem there (except what will be shown later in the post) Edit/Delete - first column - 'JobTypeID' - in...
2
by: shapper | last post by:
Hello, I am working with a ListView but I suppose that with a GridView might be the same. Instead of having an Insert Button on each GridView row I would like to have only one Insert button,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.