How can I show custom string such as "N/A" in DataGrid instead (null) for null columns?
C#
2
Posts
1
Posters
1
Views
1
Watching
-
How can I show custom string such as "N/A" in DataGrid instead (null) for null columns? My datagrid data will load by a DataSource. Or how can I filter sum record/field when loading fata from DataSource to DataGrid !? Thank you
-
How can I show custom string such as "N/A" in DataGrid instead (null) for null columns? My datagrid data will load by a DataSource. Or how can I filter sum record/field when loading fata from DataSource to DataGrid !? Thank you
I found it ...:suss:
int nColCount = dataGrid1.DataSource.Tables[0].Columns.Count; int nStyleCount = dataGrid1.TableStyles.Count; for(int nSC= 0; nSC < nStyleCount; nSC++ ) for(int nCol = 0; nCol < nColCount; nCol++ ) { dataGrid1.TableStyles[nSC].GridColumnStyles[nCol].NullText = "N/A"; }