Solved

How to make the datagridview in vb.net windows form as non editable and with hyperlink.

Posted on 2012-04-02
3
231 Views
Last Modified: 2012-04-09
1.How to make Datagridview as non editable.
2.I am getting the output as select id,name,location from emp into datagridview.
3.How can i make the id as link or button or something. Which can be clicked and
loads editform
The editform
contains 3 textboxes id, name and location.
where name and location is assigned automatically.
0
Comment
Question by:searchsanjaysharma
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37795265
1) Set its ReadOnly property to true
2) ok
3) You can use double click to edit the row. If you want button then
    http://vb.net-informations.com/datagridview/vb.net_datagridview_button.htm
0
 
LVL 5

Expert Comment

by:hafeezmca
ID: 37795469
Hi,
In case if you dont want to do any sort of coding then follow this way.

Create a table with the following structure in your sql server:

id (int) Primary key with Indentity specification to true, name nvarchar2(100) and location nvarchar2(100)

Drag a GridView and configure the Datasource and let the grid populate itself.
By default you will have all the fields in read only mode.

Goto Gridview properties and add the select Edit,Update,Cancel Command.
Once done you will be able to edit the record. Note that the Id is automatically in read only mode.
In case if you want the name to be in ReadOnly mode then go to Gridview properties and select the Name field, make it Readonly property to True.
Hope this is what you are trying to achieve.
0
 

Author Closing Comment

by:searchsanjaysharma
ID: 37822544
ok
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

810 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