protected override void PerformDataBinding(IEnumerable data)
{
SetData();
if (this.DataSource != null) {
Type theType = this.DataSource.GetType();
if (theType.IsGenericType && theType.GetGenericTypeDefinition() == typeof(List<>)) {
data = (IList)this.DataSource;
}
if (this.DataSource is DataSet || theType == typeof(DataSet)) {
if (((DataSet)this.DataSource).Tables.Count > 0) {
data = ((DataSet)this.DataSource).Tables[0].AsDataView();
}
}
if (this.DataSource is DataTable || theType == typeof(DataTable)) {
data = ((DataTable)this.DataSource).AsDataView();
}
}
base.PerformDataBinding(data);
if (string.IsNullOrEmpty(SortField) || string.IsNullOrEmpty(SortDir)) {
SortParm = string.Empty;
}
this.LinkButtonCommands = "";
if (this.Rows.Count > 0) {
WalkGridSetClick(this.HeaderRow);
}
}