[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

vb.net 2008 Datagridview Disable Edit on colunm

Posted on 2009-04-07
5
Medium Priority
?
3,126 Views
Last Modified: 2013-11-26
i use datagridview on vb.net 2008 .how to not allow user to edit only column 1 and column 12
0
Comment
Question by:aarontham
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Expert Comment

by:NicksonKoh
ID: 24094265
Did you try setting the field to just read only as in ReadOnly="True"?
0
 
LVL 9

Expert Comment

by:Sreedhar Vengala
ID: 24094271
           p2pDataContext p = new p2pDataContext();
           
            dataGridView1.DataSource = (from a in p.Stockpiles select a).ToList();
            dataGridView1.Columns[0].ReadOnly = true;
            dataGridView1.Columns[1].ReadOnly = true;
0
 
LVL 9

Expert Comment

by:Sreedhar Vengala
ID: 24094275
for col 1 and 12 to make readlnly (non editable)
dataGridView1.Columns[1].ReadOnly = true;
dataGridView1.Columns[12].ReadOnly = true;
0
 
LVL 9

Accepted Solution

by:
Sreedhar Vengala earned 2000 total points
ID: 24094281
VB:
dataGridView1.Columns(1).[ReadOnly] = True
dataGridView1.Columns(12).[ReadOnly] = True
0
 
LVL 17

Expert Comment

by:NicksonKoh
ID: 24094284
Here's how u do in design mode.
<Columns>
    <asp:BoundField DataField="Column1" HeaderText="Column1" ReadOnly="True" SortExpression="Column1" />
    <asp:BoundField DataField="Column2" HeaderText="Column2"  SortExpression="Column2" />
</Columns>

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question