Showing posts with label paging. Show all posts
Showing posts with label paging. Show all posts

Thursday, March 29, 2012

Performance question

I have one question.

DataGrid control is performance cost.Use any other control if possible. That
is by the book.
But I need sorting and paging on all my pages.

So, is there any better solution or I should use dataGrid anyway?

Thank you,
SimonSimon,

Suppose we have 100 thousand records in a datagrid, you
just click next page of data grid and it go get those
100 thousand records again, bind them, and take you
to next page.

what we did we cached datatable in an application object,
and bound it with data grid, and refreshed application object
on every insert/update/delete.

heres some code I used to load datatable for the first time,
or if it is already loaded, use from cache:
If context.Application("dvInvoices") Is Nothing Then
Dim dtTemp As DataTable = daoDgrCache.InvoicesSelectAll '// get
datatable from database
context.Application.Lock()
context.Application("dtInvoices") = dtTemp '// caches invoices datatable
context.Application.UnLock()
End If

datagrid1.DataSource = CType(context.Application("dtInvoices"),
DataTable).Copy.DefaultView

and on invoice record insert/update/delete, I called a proc
to refresh cache by doing this:
Dim dtTemp As DataTable = daoDgrCache.InvoicesSelectAll '// get datatable
from database
context.Application.Lock()
context.Application("dtInvoices") = dtTemp '// caches invoices datatable
context.Application.UnLock()

You can also use per-session caching and file caching.
--
Hope this helps,
Zeeshan Mustafa, MCSD

"simon" <simon.zupan@.stud-moderna.si> wrote in message
news:ez5bylCWEHA.1380@.TK2MSFTNGP12.phx.gbl...
> I have one question.
> DataGrid control is performance cost.Use any other control if possible.
That
> is by the book.
> But I need sorting and paging on all my pages.
> So, is there any better solution or I should use dataGrid anyway?
> Thank you,
> Simon
I don't see any issues using the DataGrid. How many rows are we talking
about in your case. You should also take intto consideration the method
of creating tables in class ASP compared to the performance of compiled
code and also the time taken to implement the features like sorting,
paging, in-line editing etc. The extra money that you can save I feel
that you can invest in your hardware.

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
If you came up with your own solution, chances are, it wouldn't have a much
smaller footprint, but the downside would be that it was proprietary, and
therefore, more expensive in the short and long run. I would stick with the
DataGrid.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"simon" <simon.zupan@.stud-moderna.si> wrote in message
news:ez5bylCWEHA.1380@.TK2MSFTNGP12.phx.gbl...
> I have one question.
> DataGrid control is performance cost.Use any other control if possible.
That
> is by the book.
> But I need sorting and paging on all my pages.
> So, is there any better solution or I should use dataGrid anyway?
> Thank you,
> Simon

Performance question

I have one question.
DataGrid control is performance cost.Use any other control if possible. That
is by the book.
But I need sorting and paging on all my pages.
So, is there any better solution or I should use dataGrid anyway?
Thank you,
SimonSimon,
Suppose we have 100 thousand records in a datagrid, you
just click next page of data grid and it go get those
100 thousand records again, bind them, and take you
to next page.
what we did we cached datatable in an application object,
and bound it with data grid, and refreshed application object
on every insert/update/delete.
heres some code I used to load datatable for the first time,
or if it is already loaded, use from cache:
If context.Application("dvInvoices") Is Nothing Then
Dim dtTemp As DataTable = daoDgrCache.InvoicesSelectAll '// get
datatable from database
context.Application.Lock()
context.Application("dtInvoices") = dtTemp '// caches invoices datatable
context.Application.UnLock()
End If
datagrid1.DataSource = CType(context.Application("dtInvoices"),
DataTable).Copy.DefaultView
and on invoice record insert/update/delete, I called a proc
to refresh cache by doing this:
Dim dtTemp As DataTable = daoDgrCache.InvoicesSelectAll '// get datatable
from database
context.Application.Lock()
context.Application("dtInvoices") = dtTemp '// caches invoices datatable
context.Application.UnLock()
You can also use per-session caching and file caching.
--
Hope this helps,
Zeeshan Mustafa, MCSD
"simon" <simon.zupan@.stud-moderna.si> wrote in message
news:ez5bylCWEHA.1380@.TK2MSFTNGP12.phx.gbl...
> I have one question.
> DataGrid control is performance cost.Use any other control if possible.
That
> is by the book.
> But I need sorting and paging on all my pages.
> So, is there any better solution or I should use dataGrid anyway?
> Thank you,
> Simon
>
I don't see any issues using the DataGrid. How many rows are we talking
about in your case. You should also take intto consideration the method
of creating tables in class ASP compared to the performance of compiled
code and also the time taken to implement the features like sorting,
paging, in-line editing etc. The extra money that you can save I feel
that you can invest in your hardware.
Regards,
Trevor Benedict R
MCSD
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
If you came up with your own solution, chances are, it wouldn't have a much
smaller footprint, but the downside would be that it was proprietary, and
therefore, more expensive in the short and long run. I would stick with the
DataGrid.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"simon" <simon.zupan@.stud-moderna.si> wrote in message
news:ez5bylCWEHA.1380@.TK2MSFTNGP12.phx.gbl...
> I have one question.
> DataGrid control is performance cost.Use any other control if possible.
That
> is by the book.
> But I need sorting and paging on all my pages.
> So, is there any better solution or I should use dataGrid anyway?
> Thank you,
> Simon
>

Wednesday, March 21, 2012

persist Checkbox state in datagrid

hi,

i have a datagrid control in a page with checkbox column and paging option.
i selected some checkbox and going to next page or prev page, if i come back to the same page
the checkbox is not checked in that page.

so how to persist that checked item throughout the datagrid?

can any one help me with codingWhen the page is changed the DataGrid is data bound again therefore repopulating everything from the data source. This means any changes made client-side are lost. Save the changes made to the data source before data binding.

DJ

Friday, March 16, 2012

Persistence

Hi,
I have a datagrid with a checkbox column. The datagrid is using paging and
sorting. When I click on a checkbox then go to page 2 (or any other) then
come back to page 1 the checkbox is cleared!
Any suggestions?
Thanks,
YamaYama,
The datagrid is being re-populated each time you change pages and that
clears the checkbox on the previous page. (The datagrid is being persisted
using viewstate which only stores the objects currently displayed. You'll
need to store previous page's checkbox values in a database, in viewstate,
or session variables and then restore them.
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Yama" <yamajan@.cox.net> wrote in message
news:eJVwpGSeEHA.3864@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have a datagrid with a checkbox column. The datagrid is using paging and
> sorting. When I click on a checkbox then go to page 2 (or any other) then
> come back to page 1 the checkbox is cleared!
> Any suggestions?
> Thanks,
> Yama
>

Persistence

Hi,

I have a datagrid with a checkbox column. The datagrid is using paging and
sorting. When I click on a checkbox then go to page 2 (or any other) then
come back to page 1 the checkbox is cleared!

Any suggestions?

Thanks,

YamaYama,

The datagrid is being re-populated each time you change pages and that
clears the checkbox on the previous page. (The datagrid is being persisted
using viewstate which only stores the objects currently displayed. You'll
need to store previous page's checkbox values in a database, in viewstate,
or session variables and then restore them.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Yama" <yamajan@.cox.net> wrote in message
news:eJVwpGSeEHA.3864@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have a datagrid with a checkbox column. The datagrid is using paging and
> sorting. When I click on a checkbox then go to page 2 (or any other) then
> come back to page 1 the checkbox is cleared!
> Any suggestions?
> Thanks,
> Yama