473,503 Members | 13,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disabling Link Button Column in Datagrid

Hello world,

I have a simple datagrid on asp.net web form , in which I am showing a
single button column called EDIT. The code in the .aspx files for the same is
as below.

<asp:ButtonColumn HeaderText="" ButtonType="LinkButton" Text="Edit"
CommandName="EditRec">
<ItemStyle Font-Bold="false" VerticalAlign="Top"
HorizontalAlign="left" Width="30" Height="35"></ItemStyle>
</asp:ButtonColumn>

Currently, I am displaying this Edit link button for every record in the
datagrid. I want to know how can i selectively disable EDIT link button for
few records based on what value is in any single datagrid column. I need to
disable it through the code and NOT when the user does anything on the screen.

(I am using ASP.NET 1.1)

Any ideas

thanks all
pradeep_TP
Nov 25 '05 #1
2 10009
Try doing it in the ItemDataBound
Patrick

"pradeep_TP" <pr*******@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
Hello world,

I have a simple datagrid on asp.net web form , in which I am showing a
single button column called EDIT. The code in the .aspx files for the same is as below.

<asp:ButtonColumn HeaderText="" ButtonType="LinkButton" Text="Edit"
CommandName="EditRec">
<ItemStyle Font-Bold="false" VerticalAlign="Top"
HorizontalAlign="left" Width="30" Height="35"></ItemStyle>
</asp:ButtonColumn>

Currently, I am displaying this Edit link button for every record in the
datagrid. I want to know how can i selectively disable EDIT link button for few records based on what value is in any single datagrid column. I need to disable it through the code and NOT when the user does anything on the screen.
(I am using ASP.NET 1.1)

Any ideas

thanks all
pradeep_TP

Nov 25 '05 #2
thank you patrick. I have solved the problem myself :). Following is what I did

1) Added a template column and inside it i added a linkButton server control.
2) The enabled property of the link button was set as below

<asp:LinkButton id="LinkButton1" Enabled =
'<%#Convert.ToInt16(DataBinder.Eval(Container.Data Item,"employeeid"))==1?Convert.ToBoolean("True"):C onvert.ToBoolean("False")%>' runat="server">

cheers!
pradeep

"Patrick.O.Ige" wrote:
Try doing it in the ItemDataBound
Patrick

"pradeep_TP" <pr*******@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
Hello world,

I have a simple datagrid on asp.net web form , in which I am showing a
single button column called EDIT. The code in the .aspx files for the same

is
as below.

<asp:ButtonColumn HeaderText="" ButtonType="LinkButton" Text="Edit"
CommandName="EditRec">
<ItemStyle Font-Bold="false" VerticalAlign="Top"
HorizontalAlign="left" Width="30" Height="35"></ItemStyle>
</asp:ButtonColumn>

Currently, I am displaying this Edit link button for every record in the
datagrid. I want to know how can i selectively disable EDIT link button

for
few records based on what value is in any single datagrid column. I need

to
disable it through the code and NOT when the user does anything on the

screen.

(I am using ASP.NET 1.1)

Any ideas

thanks all
pradeep_TP


Nov 25 '05 #3

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

Similar topics

2
7782
by: Jeelz | last post by:
Hi Guyz, Would appriciate any tip on disabling an ASP.NET LinkButton using client sided code like javascript. My Requirement is such that the user should be allowed to click on the link...
0
1185
by: Douglas Gierow | last post by:
a long time ago, someone asked the question: "I'm using a link button for a Select Button Column in a datagrid. Based on information within the grid I'm doing a response.redirect to a different...
1
390
by: Darren Clark | last post by:
I have a link button that i would like to be used if the value of the text is NOT 0... So the code below will always make a linkbutton.... However if the value of...
1
1231
by: Robin | last post by:
In an ASP.NET page that has a data grid with a bound column of link button. How can I reference the control and set properties for the link button at run time?
2
2359
by: JenHu | last post by:
hi, I have a datagrid in my asp.net application, I am using vb.net language. I want to have my last column as a link column, link to text file. The link path is "c:\Temp\" & F_File_Name, which...
2
2421
by: Bob Hollness | last post by:
Hi group. I am a newbie to ASP.NET as you will see from some of the questions I may ask! I have a datagrid which I have populated from a database. It works great! I have added a column, via...
6
2541
by: sonic | last post by:
Hi, I am experimenting with different viewstate management ideas for large datagrids, and found a microsoft suggestion to turn it off, and only store relevant information by manually accessing...
13
1398
by: John M | last post by:
Hello, In Visual studio .NET 2003, On datagrid object : How can I link the button element : edit, to do a some client events (such as message box, and do another event just after that to the...
2
1474
by: Bazza Formez | last post by:
Hello, In my aspx file I have a LinkButton inside a template column, inside a datagrid. I have assigned a CommandName to the button. In my code behind, I attempt to trap the command in the...
0
7213
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
7366
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...
1
7017
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
7471
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
5610
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,...
0
4698
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
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.