用 gridview 实现插入功能时遇到的问题
在网上看了一篇文章:没有数据时如何显示header和footer:
public class QGridView : GridView
{
#region Properties
/// <summary>
/// Enable or Disable generating an empty table if no data rows in source
/// </summary>
[
Description( "Enable or disable generating an empty table with headers if no data rows in source "),
Category( "Misc "),
DefaultValue( "true "),
]
public bool ShowEmptyTable
{
get
{
object o = ViewState[ "ShowEmptyTable "];
return (o != null ? (bool)o : true);
}
set
{
ViewState[ "ShowEmptyTable "] = value;
}
}
/// <summary>
/// Get or Set Text to display in empty data row
/// </summary>
[
Description( "Text to display in empty data row "),
Category( "Misc "),
DefaultValue( " "),
]
public string EmptyTableRowText