By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,484 Members | 1,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,484 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
Anybody?

Mar 3 '06 #4

P: n/a
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

P: n/a
Thanks carl.

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

Mar 4 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.