[英]Dynamically Add a Row to a Gridview at Runtime
Is it possible to add a row to a gridview at runtime?是否可以在运行时向 gridview 添加一行? I need to add a default row(sometimes) and then add an adhoc row after the bound row based on a value in the bound row.
我需要添加一个默认行(有时),然后根据绑定行中的值在绑定行之后添加一个临时行。
gridView.DataSource = source;
/// Create a new Default Row here
gridview.DataBind();
AND和
OnDataBound(object sender, DataGridEventArgs e)
//evaluate each row and if certain criteria add a new row.
It would be easier to determine if you need to add additional rows before databinding.在数据绑定之前确定是否需要添加其他行会更容易。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.