473,569 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Keep colored cells of my datagrid in memory

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.

Nov 19 '05 #1
5 1024
ItemCreated is a wrong event for your purpose. You should use either
ItemDataBound or PreRender.

Eliyahu

"Franck" <we**********@g mail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
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.

Nov 19 '05 #2
Whatever Event I use, cells colors are not kept in memory.

Nov 19 '05 #3
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

"Franck" <we**********@g mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Whatever Event I use, cells colors are not kept in memory.

Nov 19 '05 #4
I knew I'll have to do sth like that...
Just hope to find another way.

Thks for your help

Eliyahu Goldin wrote:
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

"Franck" <we**********@g mail.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Whatever Event I use, cells colors are not kept in memory.


Nov 19 '05 #5
On Mon, 27 Jun 2005 11:36:08 +0200, Eliyahu Goldin wrote:
ItemCreated is a wrong event for your purpose. You should use either
ItemDataBound or PreRender.

Eliyahu

"Franck" <we**********@g mail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
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.

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.

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2371
by: Ariel Gimenez | last post by:
Morning! After several hours breaking my mind, finally my code works, but i think is trash-code, can someone tellme how is the correct way to access the value of my cells within a datagrid?... in some cases i can access the values with e.Item.Cells.Text, but in other cases i have to do weird thinks like the following: TextBox pp; //I...
2
2681
by: Craig Buchanan | last post by:
Is there a way to add a row to a datagrid during the ItemDataBound event? I would like to add a 'header' row before the start of a group of rows. Thanks, Craig Buchanan
4
1720
by: EMW | last post by:
For my ASP.NET program I want to use the datagrid as a sort of planning tool. Based on the information in a XML file, a cell of the datagrid must show an image... Well, this is what I would like it to do, but is it possible and how can I place an image in a web-datagrid cell? rg,
1
2143
by: martin | last post by:
Hi, I have a datagrid that contains 3 colums. This is rendered to the page fine, except that I would like to be able to control the width of each table cell of the datagrid I have the following code in the "ItemDataBound" -- which I belive should allow me to alter the width of the cells, however it does not work. Dim unitWidth As Unit...
0
1270
by: Eugene | last post by:
Hi everybody! Got the logical error (wrong row (SSN) selected on SelectedIndexChange event) when made a sort by non-key field in Datagrid. Used this Sub to keep the keyfield ("SSN"): Private Sub dgrMain_SelectedIndexChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles
3
1969
by: tshad | last post by:
How do I get blank cells to show in my dataGrid? I am databinding to my datagrid, but any cells that are blank, don't show. Normally, you would put an &nbsp in the cell to make IE display the cell normally. In other browsers you can use the css statement empty-cells:show. But this doesn't work in IE. Thanks,
1
1316
by: David Tilman | last post by:
I have an ASP .NET web application that changes datagrid cells in the ItemDataBound event, like changing the Columnspan of a cell to 2 and deleting the adjacent cell, so that I have two cells merged into one. I was wanting to do something similar in another part of the program (right after the DataBind() for the datagrid). Where I could select...
0
1629
by: cwbp17 | last post by:
I'm having trouble updating individual datagrid cells. Have two tables car_master (columns include Car_ID, YEAR,VEHICLE) and car_detail (columns include Car_ID,PRICE,MILEAGE,and BODY);both tables have a FK relationship on CAR_ID so the oracledataadapter1 select statement(CommandText) is: select car_master.car_id,...
0
1487
by: rn5a | last post by:
This is the code of a DataGrid: <asp:DataGrid ID="dgCart" OnEditCommand="EditCart" OnCancelCommand="CancelUpdate" OnDeleteCommand="DeleteFromCart" OnItemCommand="ButtonClicked" OnPreRender="ChangeWidth" OnUpdateCommand="UpdateCart" AutoGenerateColumns="false" runat="server"> <Columns>
0
7701
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7677
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.