One. DataGrid update Enter data regular verification RequiredFieldValidator
The control is used to verify that the value is entered in an input box, and the RegulaRexpressionValidator control is used to match the regular expression.
For a description of the regular expression, please refer to other information. Where the ControlTovAlidate property is the ID number of the text box that needs to be verified. The text in the tab is the prompt displayed when the calibration is unsuccessful. The Display property is the display of the prompt information. The contents of the , , , several Label, where is the label column of DataGrid when it is normal, is also the style of the DataGrid column in the editing state. "ASP: DATAGRID ID =" MyDataGrid "runat =" server " BorderColor = "# CCCCCC" Font-Size = "100%" HorizontalAlign = "Center" AutoGenerateColumns = "False" OnDeleteCommand = "MyDataGrid_Delete" OnSortCommand = "Sort_Grid" OnPageIndexChanged = "MyDataGrid_PageIndexChanged" DataKeyField = "SID" PagerStyle-Position = "Bottom "PagerStyle-HorizontalAlign =" Center "PagerStyle-Mode =" NextPrev "PageSize =" 10 "AllowSorting =" True "AllowPaging =" True "CellPadding =" 4 "Width =" 100% "OnEditCommand =" MyDataGrid_Edit "OnCancelCommand =" MyDataGrid_Cancel "OnupdateCommand =" mydataGrid_update "> alternatingItemStyle> headerstyle> < / asp: editcommandcolumn>
Cis lycopene HeaderTemplate> <% # this.MyDataGrid.CurrentPageIndex * this.MyDataGrid.PageSize Container.ItemIndex 1%> ItemTemplate> asp: TemplateColumn> ask: boundcolumn> Annual monthly day headertemplate> <% # databinder.eval (container, "dataItem .TD_Time "," {0: d} ")%> ItemTemplate> asp: textbox> edititemtemplate> asp: templateColumn> Columns> PagerStyle> asp: datagrid> aspx.cs in protected void MyDataGrid_Update (Object sender, DataGridCommandEventArgs E) {string SID = (Strin) g) MyDataGrid.DataKeys [(int) E.Item.itemindex]; string Updata1 = ((TextBox) E.Item.FindControl ("txtdatetd")). Text; // Database Update code myDataGrid.editIndEx = -1; bindgrid ();} In these tags we can insert the control, then use DataGrid1.Item [i] .FindControls in the background code to operate the controls in the DataGrid. You can also use if (E.Item) .ItemType == ListiteMTYPE.ITEM) {E.Item.cells [0] .attributes.add ("onclick", "Return Confirm)