Keep colored cells of my datagrid in memory

F

Franck

Hi,
I'm addin javascript on some of my datagrid cells in the
ItemCreatedEven which changes cell color on click (simulating
selection).

However, Postback event erase all selection and bring back default grid
color.

How can I keep in memory the user selection ?

Thks for help.
 
E

Eliyahu Goldin

ItemCreated is a wrong event for your purpose. You should use either
ItemDataBound or PreRender.

Eliyahu
 
F

Franck

I knew I'll have to do sth like that...
Just hope to find another way.

Thks for your help
 
E

Eliyahu Goldin

Do you mean you want to keep the color that was set on client side in
javascript? The server has no idea about what is going on in javascripts on
client side. You have to communicate color setting information from client
to server separately, for example to code it in a string and pass it up in a
hidden input control.

Eliyahu
 
I

intrader

ItemCreated is a wrong event for your purpose. You should use either
ItemDataBound or PreRender.

Eliyahu
Keep in mind the entirely separate domains you are using in web
applications: client-side and server-side do not mix well. ASP.NET
attempts to make it possible to have applications behave as it the
if the client-side is fully accessible at the server on PostBack.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top