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

LinkButton in GridView Display Issue

I have a GridView that is dynamically-bound to a class object datasource and
in that GridView is a link button column. This linkbutton displays the
number of "matches" found in a database after a query and users can click on
the link (underlined number) to display the matches. This works fine when
there are "matches" but when no matches in the database are found, what
displays in that GridView column is an underlined zero indicating it can be
clicked (and it can be with of course no dataset displayed).

Is there any way when the DataTextField for a link button is zero to NOT
have the linked value underlined or even active as a link? Thanks.
Apr 5 '07 #1
2 1836
You might use some GridView event like RowDataBound to disable the
link button

Apr 5 '07 #2
Thanks. Although not exactly what I wanted, I changed the datasource column
from an integer to a string and pass an empty string to the GridView when
the results were 0 and so nothing shows up in that column. I would have
preferred a zero without an underline and a disabled link.

"donet programmer" <ar******@gmail.comwrote in message
news:11*********************@l77g2000hsb.googlegro ups.com...
You might use some GridView event like RowDataBound to disable the
link button

Apr 5 '07 #3

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

Similar topics

7
by: Alex Maghen | last post by:
I have a DataGrid control with a LinkButton command column that deletes the row. What I want to do is set it up so that there's a client-side Confirm alert BEFORE the actual Delete command gets...
4
by: Ram | last post by:
Hi All, I am binding a GridView control using object data source. I have included a linkbutton with in the gridview and using its commandname property , I am passing few values( id and name...
5
by: graphicsxp | last post by:
Hi, I've added a linkbutton field to my gridview. Now I would like that when the user clicks on it for a particular row, a server-side function should be executed, which takes as parameters the id...
0
by: jm | last post by:
I have a Gridview with a LinkButton. The button has text from my database. It is not the datakey of the database, just free form text. I want to populate another gridview based upon the data in...
2
by: CJM | last post by:
I have a page that allows the user to search a DB by querying one of 3 fields. When results are returned, I want the user to be able to click a value in one of three columns (that directly relate...
3
by: Ben | last post by:
Hi, i try to reach in code-behind a linkbutton embedded into an ItemTemplate element of a gridview. But i'm stuck .... <Columns> <asp:TemplateField><ItemTemplate> <asp:LinkButton ID="lb1"...
4
by: Jeff | last post by:
Hi, I have a ASP.NET 2.0 Web Application. Many of the pages use the ASP.NET GridView with paging and sorting. One of the columns of this Gridview is a template column (LinkButton). The data being...
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
5
by: Eric | last post by:
Hi, there are several gridviews all with a linkbutton which all trigger the same procedure. I need to know from which gridview the linkbutton has been clicked. Thanks Eric Here the code:
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.