How do I prevent the datagrid null values from showing up as "null" instead of just plain empty. I already have these codes..
dgtsSchool.MappingName = "FacultySchool"
dgtsSchool.AlternatingBackColor = Color.AliceBlue
dgtsSchool.GridColumnStyles(0).Width = 200
dgtsSchool.GridColumnStyles(2).Width = 250
I tried adding:
Dim dte as New DataGridTextBoxColumn()
dte.NullText = ""
But I'm getting an error adding the dte!
I can't get the set DefaultValue thing to work for me but the following works for sure:
1.) We get an array of datarows from our dataTable.
2.) We go through each column in each cell in the column where we want to get rid of the 'null'
3.) Set each row's column to its string version - when it's 'null' the string version will be "", otherwise it will be what we want.
If anyone finds a a more efficent way that works please let me know.
ok, here's the code:
DataRow drMyRow = dtMyDataTable.Select();
for(int i=0; i < numRecords; i++)
drPropName[i]["columnToEdit"] = drPropName[i]["columnToEdit].ToString();