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

How to dynamically enable/disable row editing in GridView control (ASP.NET 2.0) ?

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 on button, which was
clicked by user.

Thanks in advance,
misiek

Feb 28 '06 #1
5 19012
Misiek,

You can put a row in edit mode with:

GridView1.EditIndex

EditIndex gets or sets the row to edit.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"misiek" <pt*********@poczta.fm> wrote in message
news:11**********************@t39g2000cwt.googlegr oups.com...
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 on button, which was
clicked by user.

Thanks in advance,
misiek

Feb 28 '06 #2
Justin, I know that.

What I meant was not to enable editing of certain row in GridView, but
enabling/disabling Edit button, which is used for editing.
I use standard Edit button from designer. I would like it to be visible
only in certain circumstances.

Do you know how it can be done?

misiek

Feb 28 '06 #3
Anybody?

Mar 3 '06 #4
There are a number of ways to do this. If you just want to remove the
button from a row, you can use:

row.Cells[0].Controls.Clear();

Assuming that your edit button is in the first column. You can also
convert it to a TemplateColumn and hide it like you would any control
in a grid.

-Carl

Mar 3 '06 #5
Thanks carl.

I did it in such way: GridViewPI.Columns[1].Visible = false;

Mar 4 '06 #6

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

Similar topics

0
by: Steve | last post by:
When coding in vbscript asp, I did everything from scratch and could control the way that for example my data tables looked and could be edited. I for example could allow the user to delete...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
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...
0
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: ...
2
by: rn5a | last post by:
In a shopping cart app, assume that a user has placed 4 orders (each order has a corresponding OrderID which will be unique). When he comes to MyCart.aspx, by default, the details of his last order...
3
abehm
by: abehm | last post by:
Hey all, I'm trying to disable a couple controls if a user clicks on a certain item in a dropdown list. I can do it on postback, but if someone could help me to do it dynamically, that would be key!...
1
by: Mel | last post by:
I want to disable the editing of a row in my gvParts GridView control. How? I need to evaluate the value of one Template Field to determine if the record should be edited or not but the template...
3
by: sanndeb | last post by:
I want to enable/disable controls of a asp.net page against a logged in user's permission. say 'admin' & 'hr' can change user's birth date text-box in a page but others will see the text-box as...
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?
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
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
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,...
0
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...

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.