Link to home
Start Free TrialLog in
Avatar of Maggs065
Maggs065

asked on

Databing using DataGridViewCheckBoxCell in VB.Net

VB.NET DataGridView

I am trying to bind my sql data results to a DataViewGrid control. However, I need to check if one value is blank and if it is I need to set another value on the same row to an empty string. I don't want to have to loop through each row and I was wondering if it would be possible to use the DataGridViewCheckBoxCell to implement a solution.

Thank you,
Maggs
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

But the DataGridViewCheckBoxCell is for boolean values not for strings/integers values
Avatar of Maggs065
Maggs065

ASKER

Sorry, I meant using the DataGridViewTextBoxCell.
You can select the dgv, then edit column and select your column. On the bound column propertires choose default cell style and set the null value to what you want.

This will replace all the null values by your value.
Hi ipaulino,
Could you perhaps provide a snippet of code to illustrate your solution? The old brain isn't working too well to-day!
Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial