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

Any way to disable a column in a DataGrid?

P: n/a
Hello,

I have a Datagrid with two rows, "Product Description" and "Serial Number".
I want the user to be able to add / edit the serial number, but not the
Product Description. In fact, I don't even want the description to be able
to get the focus (i.e. disabling the column). Is there anyway to do this?

Thanks!
Mar 17 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hello Rico" r c o l l e n s h e m m i n g w a y . c o mREMOVE THIS PART IN
CAPS,

You mean column?
Which grid -Win/Web? For example for web grid you can mark textbox in editTemplate
as readonly when EditCommand happend

R> I have a Datagrid with two rows, "Product Description" and "Serial
R> Number". I want the user to be able to add / edit the serial number,
R> but not the Product Description. In fact, I don't even want the
R> description to be able to get the focus (i.e. disabling the column).
R> Is there anyway to do this?

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 17 '06 #2

P: n/a
"Rico" <r c o l l e n s @ h e m m i n g w a y . c o mREMOVE THIS PART
IN CAPS> said:
Hello,

I have a Datagrid with two rows, "Product Description" and "Serial Number".
I want the user to be able to add / edit the serial number, but not the
Product Description. In fact, I don't even want the description to be able
to get the focus (i.e. disabling the column). Is there anyway to do this?


Look into using templates for the control rather than the default.

FWIW,

Greg G.
Mar 17 '06 #3

P: n/a
Hi Michael,

My apologies, it's in a Windows form (not sure where the "two rows" came
from, but it is afterall....Friday er..at least here in Canada it is.). I
have been bouncing back and forth and accidentally posted in ASPNet
(oops...sorry).

I have searched as best I could for a solution, but can't seem to find
anything outside of setting the column to readOnly. Any direction would be
great.

Thanks!
"Michael Nemtsev" <ne*****@msn.com> wrote in message
news:9c**************************@msnews.microsoft .com...
Hello Rico" r c o l l e n s h e m m i n g w a y . c o mREMOVE THIS PART IN
CAPS,

You mean column?
Which grid -Win/Web? For example for web grid you can mark textbox in
editTemplate as readonly when EditCommand happend

R> I have a Datagrid with two rows, "Product Description" and "Serial
R> Number". I want the user to be able to add / edit the serial number,
R> but not the Product Description. In fact, I don't even want the
R> description to be able to get the focus (i.e. disabling the column).
R> Is there anyway to do this?

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche

Mar 17 '06 #4

P: n/a
Rico,

Will you be so kind that when you post to the newsgroup languages.vb and
dotnet.general and are writing about a Datagrid to tell that it is about
ASPNET.

In those two newsgroup WinForms is the default.

Because that you also have posted to ASPNET, I could see that you mean an
ASPNET form.

Thanks in advance.

Cor

"Rico" <r c o l l e n s @ h e m m i n g w a y . c o mREMOVE THIS PART IN
CAPS> schreef in bericht news:m4FSf.155026$B94.113974@pd7tw3no...
Hello,

I have a Datagrid with two rows, "Product Description" and "Serial
Number". I want the user to be able to add / edit the serial number, but
not the Product Description. In fact, I don't even want the description
to be able to get the focus (i.e. disabling the column). Is there anyway
to do this?

Thanks!

Mar 18 '06 #5

P: n/a
Rico,

In the newsgroup General where you disconnected the other links I saw that
you have posted it wrong to ASPNET. Therefore again a question. Please as
you crosspost keep the newsgroups complete.

Here is the most simple answer on our website. If you want it more advance
than you can use the styles (as well a lot of samples on our website).

http://www.vb-tips.com/default.aspx?...3-a3539697edbd

I hope this helps,

Cor
"Cor Ligthert [MVP]" <no************@planet.nl> schreef in bericht
news:uh***************@TK2MSFTNGP12.phx.gbl...
Rico,

Will you be so kind that when you post to the newsgroup languages.vb and
dotnet.general and are writing about a Datagrid to tell that it is about
ASPNET.

In those two newsgroup WinForms is the default.

Because that you also have posted to ASPNET, I could see that you mean an
ASPNET form.

Thanks in advance.

Cor

"Rico" <r c o l l e n s @ h e m m i n g w a y . c o mREMOVE THIS PART IN
CAPS> schreef in bericht news:m4FSf.155026$B94.113974@pd7tw3no...
Hello,

I have a Datagrid with two rows, "Product Description" and "Serial
Number". I want the user to be able to add / edit the serial number, but
not the Product Description. In fact, I don't even want the description
to be able to get the focus (i.e. disabling the column). Is there anyway
to do this?

Thanks!


Mar 18 '06 #6

P: n/a
Oops! Sorry, my apologies. I think that's the second time I've done that.
I was bouncing back and forth between ASP.net and WinForms and have been
reference both quite a bit.

I'll be more careful next time.

Rick
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uh***************@TK2MSFTNGP12.phx.gbl...
Rico,

Will you be so kind that when you post to the newsgroup languages.vb and
dotnet.general and are writing about a Datagrid to tell that it is about
ASPNET.

In those two newsgroup WinForms is the default.

Because that you also have posted to ASPNET, I could see that you mean an
ASPNET form.

Thanks in advance.

Cor

"Rico" <r c o l l e n s @ h e m m i n g w a y . c o mREMOVE THIS PART IN
CAPS> schreef in bericht news:m4FSf.155026$B94.113974@pd7tw3no...
Hello,

I have a Datagrid with two rows, "Product Description" and "Serial
Number". I want the user to be able to add / edit the serial number, but
not the Product Description. In fact, I don't even want the description
to be able to get the focus (i.e. disabling the column). Is there anyway
to do this?

Thanks!


Mar 23 '06 #7

P: n/a
Ah, I see what happened! I notice that ADO.net isn't in the newsgroup list,
which is what I had intended. Again, my apologies.

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uh***************@TK2MSFTNGP12.phx.gbl...
Rico,

Will you be so kind that when you post to the newsgroup languages.vb and
dotnet.general and are writing about a Datagrid to tell that it is about
ASPNET.

In those two newsgroup WinForms is the default.

Because that you also have posted to ASPNET, I could see that you mean an
ASPNET form.

Thanks in advance.

Cor

"Rico" <r c o l l e n s @ h e m m i n g w a y . c o mREMOVE THIS PART IN
CAPS> schreef in bericht news:m4FSf.155026$B94.113974@pd7tw3no...
Hello,

I have a Datagrid with two rows, "Product Description" and "Serial
Number". I want the user to be able to add / edit the serial number, but
not the Product Description. In fact, I don't even want the description
to be able to get the focus (i.e. disabling the column). Is there anyway
to do this?

Thanks!


Mar 23 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.