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
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
But the DataGridViewCheckBoxCell is for boolean values not for strings/integers values
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.
This will replace all the null values by your value.
ASKER
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.