473,406 Members | 2,217 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,406 software developers and data experts.

disable edit button in gridview

How do you disable the edit button for selected rows in a gridview?
Here is my button :

<asp:CommandField ShowEditButton="True" ButtonType="Link"
ShowCancelButton="True"
UpdateText="Update"
EditText="Edit" CancelText="Cancel" />

*** Sent via Developersdex http://www.developersdex.com ***
Jun 7 '06 #1
1 8582
Mike P <mi*******@gmail.com>'s wild thoughts were released
on Wed, 07 Jun 2006 02:12:31 -0700 bearing the following
fruit:
How do you disable the edit button for selected rows in a gridview?
Here is my button :

<asp:CommandField ShowEditButton="True" ButtonType="Link"
ShowCancelButton="True"
UpdateText="Update"
EditText="Edit" CancelText="Cancel" />

Is this button seperate from the grid?

Anyway, when you select a row the SelectedIndexChanged event
should fire, you can set the enabled property of your button
there based on whatever your criteria is
If your asking how to disable the edit button (part of the
grid) on specific rows then I'd first set it to a template
column.

Then in the RowDataBoundEvent you can get at the button for
each row using

cmd = e.Row.FindControl("YourButtonName")

Then set the enabled property as per your requirements.


Jan Hyde (VB MVP)

--
When the man hit his head on the doorway and sued, his lawyer advised to settle for a lump sum. (Gill Krebs)

Jun 8 '06 #2

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

Similar topics

2
by: Luqman | last post by:
How can I put GridView and DetailView control to Edit Mode with one click of button ? I don't want to show built-in Edit Buttons of above controls. Best Regards, Luqman
3
by: misiek | last post by:
Hi all. I have following problem: 1. In my web page I have a GridView control, which does not have a DataSourceId set in designer. 2. When user presses Start button then I create...
5
by: misiek | last post by:
Hi all. I would like to know if it is possible to dynamically enable/disable row editing in GridView control in ASP.NET 2.0. I am asking because this feature should be enabled/disable depending...
1
by: keithb | last post by:
I have a GridView control that has a delete button (hyperlink) in one column. The datasource table contains a column that has a true/false indicator showing whether or not the record can be...
2
by: VB Programmer | last post by:
I have a gridview control with several data fields. When the user clicks 'edit' for the row I want the user to be able to edit a particular text field. Under that 'edit' textbox is a button. ...
0
by: den 2005 | last post by:
Hi everybody, I am not familiar using Gridview, I created a Gridview with Edit Command Button, but when I click the update Command button this error message below is displayed, what and where is...
2
by: ruthie | last post by:
Hi, I have a gridview with edit option. If the user chooses to edit the row and then press the Cancel button - I would like the focus to return to the chosen row. Someone has any idea how to...
3
by: =?Utf-8?B?UGxhdGVyaW90?= | last post by:
I have link buttons in a Gridview that, depending on the value in another column (Not the Key column) will need to be disabled. For example, (Column2 has link buttons) Column1 ...
0
by: =?Utf-8?B?R3JpZFZpZXcgTmV3Ymll?= | last post by:
I have a business requirement stating that when the Location Type is "C" the user should not be able to update the StoreNumber. So, when the user clicks the "edit" button in the GridView for a...
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: 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
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...
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
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...

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.