J
Jignesh Desai
Info::
Most of you must have worked on paging feature of DataGrid. its works fine as long as you have more no of records to show, but if you have configured 20 records per page and no of records you retrieved is less then 20 then also pager gets rendered at the bottom of the grid showing "1". most of us do not bother about it , but Clients ,,,uff...
Solution:
SQLDataAdapter.Fill(DS,"Emp")
If DS.Tables("Emp").Rows.Count > MyDataGrid1.PageSize then
MyDataGrid1.AllowPaging = True
Else
MyDataGrid1.AllowPaging = False
End if
MyDataGrid1.DataBind()
Any better ways?
ya perhaps this could have been reduced to one line also eg.
MyDataGrid1.AllowPaging = ( DS.Tables("Emp").Rows.Count > MyDataGrid1.PageSize )
Anything better then this?
Regards
Jignesh Desai
www.dotnetjini.com
Most of you must have worked on paging feature of DataGrid. its works fine as long as you have more no of records to show, but if you have configured 20 records per page and no of records you retrieved is less then 20 then also pager gets rendered at the bottom of the grid showing "1". most of us do not bother about it , but Clients ,,,uff...
Solution:
SQLDataAdapter.Fill(DS,"Emp")
If DS.Tables("Emp").Rows.Count > MyDataGrid1.PageSize then
MyDataGrid1.AllowPaging = True
Else
MyDataGrid1.AllowPaging = False
End if
MyDataGrid1.DataBind()
Any better ways?
ya perhaps this could have been reduced to one line also eg.
MyDataGrid1.AllowPaging = ( DS.Tables("Emp").Rows.Count > MyDataGrid1.PageSize )
Anything better then this?
Regards
Jignesh Desai
www.dotnetjini.com