Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
18016 | Aug 23,2004 06:16 AM UTC | Aug 24,2004 06:18 AM UTC | WinForms | 3 |
![]() |
Tags: GridControl |
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { if(e.Style.CellValue == null || e.Style.CellValue == DBNull.Value) { e.Style.Text = "(null)"; } }To set teh current cell to DBNull, you can use code like:
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
cc.EndEdit();
this.gridDataBoundGrid1[cc.RowIndex, cc.ColIndex].CellValue = DBNull.Value;
int field = grid.Binder.ColIndexToField(grid.CurrentCell.ColIndex);
if(myDataTable.Columns[field].AllowDBNull)
{
//accepts DBNull.
}
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.