473,378 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Strange behavior of invisible controls

Hello:

I'm updating multiple rows in the datagrid, using the routine described in
the article "Top Questions about the DataGrid Web Server Control":

http://msdn.microsoft.com/library/de...vercontrol.asp

To determine which rows had been changed, I'm using the RowChanged sub:

Protected Sub RowChanged(ByVal sender As Object, _
ByVal e As System.EventArgs)
'---------------------------------------------------------------------------
---------------------
' Add ID's for changed rows
'---------------------------------------------------------------------------
---------------------
Try
Dim dgi As DataGridItem = _
CType(CType(sender, Control).NamingContainer, DataGridItem)
Dim IDlabel As Label = CType(dgi.FindControl("lblOrder"), Label)
Dim ID As Integer = CType(IDlabel.Text, Integer)
If Not (IDlist.Contains(ID)) Then
IDlist.Add(ID)
End If
Catch ex As Exception
Me.lblError.Text = "Error No.: " & Err.Number.ToString & " - " & ex.ToString
End Try
End Sub

<asp:CheckBox id="chkInHouse" ToolTip="Plates In House" runat="server"
OnCheckedChanged="RowChanged" Checked='<%# DataBinder.Eval(Container,
"DataItem.InHouse") %>'>

It works OK everywhere, except one datagrid where some of my checkboxes are
invisible - the user has to click a button to make them visible. These
invisible checkboxes always indicate that their values had been changed. As
a result all my data from the datagrid is sent to the database, even if no
changes has been made. As soon as I make these checkboxes visible -
everything works OK.

Why is this happening? Is there any workaround?

I would appreciate your help.

Thank you,

--
Peter Afonin
Nov 18 '05 #1
2 1113
Hi,

If you set checkbox visibility by visible property and you are using
postback to change visible state maybe there is something in the
postback activity that cause that behavior.

you can change check box visibility by changing visibility attribute of
control Style using javascrit thus reducing network traffic.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
Thank you, Natty.

Do you have a JavaScript sample on how to do this? I don't know JS well.

Peter

"Natty Gur" <na***@dao2com.com> wrote in message
news:Oc*************@TK2MSFTNGP12.phx.gbl...
Hi,

If you set checkbox visibility by visible property and you are using
postback to change visible state maybe there is something in the
postback activity that cause that behavior.

you can change check box visibility by changing visibility attribute of
control Style using javascrit thus reducing network traffic.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #3

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

Similar topics

10
by: Cy | last post by:
I've had good luck with posting in the past, so we'll see how things go this time...:) I have an Access 2000 form. On the form is about 40 objects. I want to set everything to invisible,...
7
by: Martin | last post by:
Hi, I have a page where according to the mode of use, different controls are visible. I had assumed that Page.DataBind() would only bind visible controls, but apparently not. Do I have to...
2
by: Jim Bancroft | last post by:
Hi everyone, I have a DropDownList I populate as outlined below. This is from my code-behind file: private void Page_Load(object sender, System.EventArgs e) { BindMyData(); DataBind(); }
4
by: CJ Taylor | last post by:
Alright, I wrote this program that is used throughout my entire company for the past 9 months. Now, we have deployed it to well over 100 machines. So my Sys Admin comes up to me today and...
3
by: George Hardy IV | last post by:
Hello all, I have two forms in my project... one form allows me to use the arrow keys to move and delete controls on my form. the other form does NOT allow me to delete controls or move them...
0
by: Marc Robitaille | last post by:
Hello, I developed a UserControl. It has funny behavior. It is composed of three controls. A texbox, a combobox and a button. There are three properties to indicate the visibility of the three...
0
by: Andrew.Raymond | last post by:
I know this one is WAY out pushing the envelope, but I'd like to know if anyone has any ideas about it. We have a behemoth of a legacy MFC application which is now being embedded in a Windows...
6
by: Joseph Geretz | last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm adding matching pairs of Toolbar buttons and Menu items. All of the buttons and menu items are wired up to send events to...
9
by: Mel | last post by:
I have 10 columns total. 3 of them are invisible. The rest are read- only BoundFields, 3 of which are editable fields using TemplateFields. Upon editing, I want to validate what the user enters...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.