SoFunction
Updated on 2025-04-09

Thirty-three commonly used codes page 5/7


〖Remembering Home〗
<asp:TemplateColumn HeaderText="Quantity">
<ItemTemplate> 
<asp:TextBox  runat='server' Text='<%# (,"DG_ShuLiang")%>' 
onkeyup="javascript:DoCal()" 
/> 
<asp:RegularExpressionValidator  runat="server" ControlToValidate="ShuLiang" ErrorMessage="must be integer" ValidationExpression="^\d+$" /> 
</ItemTemplate> 
</asp:TemplateColumn> 
<asp:TemplateColumn HeaderText="Unit Price">
<ItemTemplate> 
<asp:TextBox  runat='server' Text='<%# (,"DG_DanJian")%>' 
onkeyup="javascript:DoCal()" 
/> 
<asp:RegularExpressionValidator  runat="server" ControlToValidate="DanJian" ErrorMessage="must be numeric" ValidationExpression="^\d+(\.\d*)?$" /> 
</ItemTemplate> 
</asp:TemplateColumn> 
<asp:TemplateColumn HeaderText="Amount">
<ItemTemplate> 
<asp:TextBox  runat='server' Text='<%# (,"DG_JinE")%>' /> 
</ItemTemplate> 
</asp:TemplateColumn><script language="javascript"> 
function DoCal() 

 var e = ; 
 var row = ; 
 var txts = ("INPUT"); 
 if (!  < 3) 
return; 
 var q = txts[-3].value; 
 var p = txts[-2].value; 
 if (isNaN(q) isNaN(p)) 
return; 
 q = parseInt(q); 
 p = parseFloat(p); 
 txts[-1].value = (q * p).toFixed(2); 

</script> 
When selecting the lower row, why do you always refresh it and then scroll to the top? The line you just selected just now cannot be seen due to the screen relationship.
page_load 
=true 
25. Modify data in Datagrid. When the edit key is clicked, the data appears in the text box. How to control the size of the text box?
private void DataGrid1_ItemDataBound(obj sender,DataGridItemEventArgs e) 

 for(int i=0;i<-1;i++) 
if(==) 

 [i].("Width", "80px") 


Previous page1234567Next pageRead the full text