W
wildman
RE: GridView calculated columns .. best place??
I've got this table without about 5000 rows.
I know as rule you should limit the number of rows passed to the grid.
But with sorting and paging options, I'd like to send them all there.
Previously, the datasource was a db view with a few columns that were
derived from a db function. A real performance killer taking 3 minutes
to display the grid.
If I remove the function columns of course the sql comes right back
fast.
I was thinking maybe I perform the calculation as rows are displayed
maybe in the forms prerender codebehind event?
I've done similar code to turn off and on grid buttons based on values
in the row, but have never have limited to only what's in the current
page (what's actually showing).
Good Idea?
How do I even limit to what's being displayed.
Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
For Each dgItem In GridOrders.Rows
Dim CashBackButton As Button =
CType(GridOrders.Rows(dgItem.RowIndex).FindControl("ReturnCash"),
Button)
Any sample code?
Thanks for any help or information.
I've got this table without about 5000 rows.
I know as rule you should limit the number of rows passed to the grid.
But with sorting and paging options, I'd like to send them all there.
Previously, the datasource was a db view with a few columns that were
derived from a db function. A real performance killer taking 3 minutes
to display the grid.
If I remove the function columns of course the sql comes right back
fast.
I was thinking maybe I perform the calculation as rows are displayed
maybe in the forms prerender codebehind event?
I've done similar code to turn off and on grid buttons based on values
in the row, but have never have limited to only what's in the current
page (what's actually showing).
Good Idea?
How do I even limit to what's being displayed.
Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
For Each dgItem In GridOrders.Rows
Dim CashBackButton As Button =
CType(GridOrders.Rows(dgItem.RowIndex).FindControl("ReturnCash"),
Button)
Any sample code?
Thanks for any help or information.