We help IT Professionals succeed at work.

Set datagridview column amounts to null

dave_sky
dave_sky asked
on
474 Views
Last Modified: 2012-05-11
Software: VB.net and SQL Server 2005

I am looking for sample code to clear amounts from a databound datagridview column on a button click event.

Thanks
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Are you using datatable/dataset at the backend?

Try setting the value to DBNull.

Author

Commented:
I am using datatable/dataset at the backend...

This works only if I highlite or set focus to to the cell with the cursor:
Me.TblPlumbingListBidDetailDataGridView(3, TblPlumbingListBidDetailDataGridView.CurrentCell.RowIndex()).Value = DBNull.Value

Any ideas?
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
I thought about that in the middle of the nite.......lol

Author

Commented:
I tried every variation of this code I could think of and could not get it to work.

Try dgv.Rows(index).Cells(index).Value

Any more ideas?
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Show me the complete code you currently have.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.