How to handle a click in a DataGrid without EnableViewState=false?

D

DC

Hi,

I want to present hirarchical data in a gridview. Each row offers a
link to another data subset.

When viewstate is off, I have to early rebuild the gridview just to
raise the damn click event (right?). Using viewstate (no matter where)
to rebuild the gridview is no option since the gridview may contain
many rows. I then have to get the newly requested data - two expensive
trips to the database, one of them not necessary in my opinion.

I could just place an anchor in the gridview and trigger a get request
with the row number in the querystring. But that is no option either,
since the gridview resides in an updatepanel and the datagrid update
is supposed to happen in a callback.

Does someone have an idea how to work around this problem?

Regards
DC
 
B

bruce barker

there is no requirement to use .net event model which requires the controls
to be created for postback.

you can acess the form collection and use you own logic. the hidden field
"__EVENTTARGET" has the postback control name (unless its a button, then the
buttons name/value pair is passed). "__EVENTARGUMENT" has the command arg if
one is used. all the rest of the postbackl control values are in the form
collection as name/value pairs.

-- bruce (sqlwork.com)
 
D

DC

there is no requirement to use .net event model which requires the controls
to be created for postback.

you can acess the form collection and use you own logic. the hidden field
"__EVENTTARGET" has the postback control name (unless its a button, then the
buttons name/value pair is passed). "__EVENTARGUMENT" has the command arg if
one is used. all the rest of the postbackl control values are in the form
collection as name/value pairs.

-- bruce (sqlwork.com)










- Zitierten Text anzeigen -

Bruce again, allright! I will check this out, sounds like the solution
I am looking for. Thanks a lot,
Regards
DC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top