473,486 Members | 2,429 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Any way to disable a column in a DataGrid?

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
7 1199
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
"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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
15430
by: Terry | last post by:
Hey, Having somewhat of an issue, I have a datagrid which is giving me issues. The Datagrid is setup for the user to double click the row, the row is selected and data within that row populates a...
2
1837
by: PAUL GROSSMAN | last post by:
Hello everyone. I am working with a DataGrid using VB .Net (Windows Forms). I want to make one of the columns un-editable. I was able to do that by setting the ...
3
7094
by: suresh | last post by:
frenz, i need to disable the add new record mode in datarid. i just want to modify the existing records in the grid...but i dont want to add new records..how do i do that? -suresh
2
5021
by: Agnes | last post by:
In myDatagrid, there is 3 columns, account code, debit,credit. If the user input some particular a account code in column1 , i need to based on the contect of column1, to disable...
1
2910
by: Geroge D. Lake | last post by:
Hi, I need to disable the resizing of a datagrid. I have tried al day and no luck. Any Ideas? Thanks. George.
1
1917
by: johnb41 | last post by:
I have a datagrid that successfully allows editing and updating (with dataadapter.update command). I want the user to be able to edit the "text" in the datagrid, but i DON'T want the user to be...
8
15134
by: simchajoy2000 | last post by:
I thought the only thing I had to do to disable column sorting in VB.NET was to set datagrid.AllowSorting = False. Unfortunately this has never worked for me. I discovered another set of code...
2
14837
by: Mike | last post by:
Hi, I would like to disable sorting in a winform datagrid when a column header is clicked. The following does *not* seem to disable sorting and clicking the column header still sorts the grid:...
1
7085
by: ECD | last post by:
Hello all, I can usually find solutions to my .NET problems by searching these groups, but I'm stumped on this one. I have a datagrid in VB.NET (2.0 framework). I want to disable sorting on...
6
8625
by: =?Utf-8?B?R2VudGlhbiBIaWxh?= | last post by:
I have a datagrid that I want to be able to allow me to edit only the first two rows and all the other rows to be read-only. How can I do that? Any insight is highly appreciated. I have spent...
0
7105
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
6967
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
7132
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
7341
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
5439
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,...
1
4870
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...
0
4564
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
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1381
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 ...

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.