Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
13644 | May 5,2004 07:22 AM UTC | May 6,2004 06:35 AM UTC | WinForms | 6 |
![]() |
Tags: GridControl |
this.gridDataBoundGrid1.CurrentCell.ErrorMessage = "my error message...";
private void gridDataBoundGrid1_CurrentCellValidating(object sender, CancelEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; if(cc.RowIndex > 0 && cc.ColIndex == 2) { double d; if(!double.TryParse(cc.Renderer.ControlText, System.Globalization.NumberStyles.Any, null, out d)) { e.Cancel = true; cc.ErrorMessage = "MyMessage"; } }
int field = this.grid.Binder.ColIndexToField(cc.ColIndex);
Type t = this.grid.GridBoundColumns[field].StyleInfo.CellValueType;
// t now has the System.Type
// if you have not explicitly added GridBoundColumns, then use grid.Binder.InternalColumns instead of grid.GridBoundColumns
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.