iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
in my project ,i set coloum DataType="System.Int32", I want to ,when i leave this cell ,it will judge the cell data type .when the cell type is not correct .it will alert message .you can look the message.png.
how can i do .thanks .here is my code
<ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="250px" OnInitializeDataSource="WebGrid1_InitializeDataSource" OnPrepareDataBinding="WebGrid1_PrepareDataBinding" Width="400px" UseDefaultStyle="True" OnPrepareExportExecute="WebGrid1_PrepareExportExecute" OnLoad="WebGrid1_Load"> <RootTable> <Columns> <ISWebGrid:WebGridColumn Caption="id" DataMember="id" Name="id" Width="100px" DataType="System.Int32"> </ISWebGrid:WebGridColumn> </Columns> </RootTable> <LayoutSettings AllowColumnFreezing="Yes" AllowColumnMove="Yes" AllowSorting="Yes" AllowAddNew="Yes" ShowColumnAction="True" AllowSelectColumns="Yes" AlwaysShowHelpButton="False" ShowRefreshButton="False" StatusBarVisible="False"> <TextSettings Language="UseCustom" UseLanguage="zh-CN"> </TextSettings> </LayoutSettings> </ISWebGrid:WebGrid>
Hello,
You can use OnRowValidate client-side event to trigger the validation before you perform adding new row.
You can try to use the following logic. This code is used to validate an empty cell. You can change the logic in order to validate the data type instead.
function WebGrid1_OnRowValidate(rowObject) { // retrieves WebGrid's object var grid = ISGetObject("WebGrid1"); // access WebGrid's RootTable var rootTable = grid.RootTable; var row = rootTable.ToRowObject(rowObject); // convert the rowObject (HTMLElement) to WebGridRow object var cells = row.GetCells(); // get collection of WebGridCell // check for empty cell for (var i = 0; i < cells.length; i++) { var cell = cells[i]; if (cell.Text == "") { var info = "Cell [" + cell.Name + "] value is empty"; alert(info); } } return false; }
Hope this helps. Thank you.
Regards,-Martin-
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname