Solved

VB 2008  - Assign a value to a non-visible Datagrid field

Posted on 2009-07-06
2
166 Views
Last Modified: 2012-05-07
My DataGridView1 has 6 column fields.  One column, uProject, has Visible set to False.  

How do I assign a value to that field.  The value is not dependent on any other field.  It is a program generated unique sequential number.  Something like: uProject = LastProject + 1.

All of the other column fields for the Row are entered by the user.

0
Comment
Question by:ljcor
2 Comments
 
LVL 4

Accepted Solution

by:
rdoran0928 earned 500 total points
ID: 24785023
I assume that you are talking about entering data for a new record.  If so, you can set the value of any column, whether visible or not as follows in DataGridView1's RowLeave event handler by doing:

DataGridView1.Item(columnIndex, DataGridView1.CurrentRow.Index).Value = uProject

or

DataGridView1.Item("columnName", DataGridView1.CurrentRow.Index).Value = uProject
0
 

Author Closing Comment

by:ljcor
ID: 31600125
OK, I'll go with that.  And thanks for the solution.
jack
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Extracting last characters in a substring 5 28
Ajax Panel Not Updating When Triggered By Timer 4 73
Modal Popup Extender control 1 22
SqlServer no dupes 25 35
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 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