The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I need a datacolumn in a databoundgrid that can check if the user entered in a number that is within a specified range. So, for example, if I specify a range that is between 10 and 20, the user cannot enter 100 into the column. Is there a maskedtextbox or something of that sort that I can use? Or is there another easy way to do it? Thanks!
GRGolda Rebecal Syncfusion Team September 26, 2007 03:57 AM UTC
Hi,
You can achieve this requirement by checking the required condition in CurrentCellValidating event.
Here is the code snippet:
void gridDataBoundGrid1_CurrentCellValidating(object sender, CancelEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; int value = Int32.Parse(cc.Renderer.ControlText); if (value < 10 || value > 20 && cc.ColIndex == 1) { e.Cancel = true; MessageBox.Show("Enter value between 10 and 20"); } }
Kindly let me know if this helps you.
We appreciate your interest in Syncfusion products.