• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 449
  • Last Modified:

Set datagridview column amounts to null

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
0
dave_sky
Asked:
dave_sky
  • 3
  • 3
1 Solution
 
CodeCruiserCommented:
Are you using datatable/dataset at the backend?

Try setting the value to DBNull.
0
 
dave_skyAuthor 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?
0
 
CodeCruiserCommented:
Because you are using the CurrentCell.

Try dgv.Rows(index).Cells(index).Value
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dave_skyAuthor Commented:
I thought about that in the middle of the nite.......lol
0
 
dave_skyAuthor 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?
0
 
CodeCruiserCommented:
Show me the complete code you currently have.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now