473,503 Members | 1,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid - Databinding a function

Hey all.

I have a question, hope its not hard, searched several groups but
couldn't find nothing like this...

I have a DataGrid with some columns with data on it,
AutoGenerateColumns=FALSE and a TemplateColumn with a Button on it.

All I want to do is, click the Button, the Button calls a function
that receives a INTEGER like:
doShow(int i) and executes the code.

The problem is the INTEGER needs to be the ID from the current line
(one button per line). The ID is on the datagrid too (but is
VISIBLE=FALSE), so I thought I could easily BIND with <%# tags but I
cant get it to work.

Any help is appreciated, im using c# btw. Thanks.

Apr 26 '07 #1
1 979
Any server control with Visible property set to false doesn't get rendered
to the client and doesn't come back on postbacks. You need to hide it with a
css rule display:none.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Jl_G_0" <jl*********@gmail.comwrote in message
news:11**********************@o40g2000prh.googlegr oups.com...
Hey all.

I have a question, hope its not hard, searched several groups but
couldn't find nothing like this...

I have a DataGrid with some columns with data on it,
AutoGenerateColumns=FALSE and a TemplateColumn with a Button on it.

All I want to do is, click the Button, the Button calls a function
that receives a INTEGER like:
doShow(int i) and executes the code.

The problem is the INTEGER needs to be the ID from the current line
(one button per line). The ID is on the datagrid too (but is
VISIBLE=FALSE), so I thought I could easily BIND with <%# tags but I
cant get it to work.

Any help is appreciated, im using c# btw. Thanks.

Apr 29 '07 #2

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

Similar topics

2
3107
by: Scott | last post by:
Hi all. A few days ago i ask this question and got a good quick response. I tried out what they said and it worked. However I have now come to try the same thing in another program and it...
0
2388
by: mike | last post by:
Hi there: I've read an excellent "how to"-article by Microsoft (no. 306227) - partly cited cited at the end of this email). I have implemented the code related to the part "How to Add a...
1
3417
by: Michelle Stone | last post by:
Hi all. I have an empty datagrid on my web form. And I add BoundDataColumn(s) to it through code. But after each postback, the columns and rows disappear. As a workabout, I tried to rebind the...
6
1465
by: Ben | last post by:
Hi I've got a problem with a custon control that inherits form the UserControl class and that used the overlib javascript library. The control works well in a standard form but when I used it in...
4
3220
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
0
1812
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...
4
2116
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a...
0
1029
by: mcollier | last post by:
I'm trying to develop a page template for the ASP.NET 1.1 project I'm working on. I want to have something like Master Pages (from ASP.NET 2.0). I'm having a problem now with databinding on a...
3
4304
by: Jl_G_0 | last post by:
Hey all, I need to add a hyperlinkcolumn to a datagrid, but the path (DataNavigateUrlFormatString) is dynamic, since the page lists files in directories. The folder name to list is stored in a...
2
994
by: Mark B | last post by:
I have a Datagrid working fine, outputting: Group Most Popular Product Code -------- ------------------------------- Earth.New Zealand 32 Earth.New Zealand
0
7203
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
7087
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
7281
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
7462
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...
1
5014
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...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.