Strange behavior of invisible controls

Strange behavior of invisible controls

Post by Peter Afon » Fri, 21 May 2004 05:26:57


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

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
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
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

1. strange behavior in referring to control on another form

2. strange behaviour WS_VISIBLE, propertypage, disabled controls

I have a propertysheet object containing a number of propertypages. I
am using MFC (VC6).

I have a number of misc controls on the first propertypage. I have a
similar number on a subsequent page, the first is a static text, the
second and third are buttons, the fourth a SysListView32. These are
implemented by manual creation in an (MFC) OnCreate handler. There
are addtional controls implemented via the typical resource template.

The SysListView32 create() is done with WS_VISIBLE absent. A routine
runs at the very beginning on the WM_INITDIALOG process which disables
(non static, non SysListView32) controls (identically on all pages.)
I then use a SetWindowPos() on the SysListView32, using

When the propertysheet becomes visible, if I first click a control
within the first page before clicking the tab of the subsequent page,
I don't get the SysListView32 painting correctly on the subsequent
propertypage. If I either, don't run the control disabling process or
I _don't_ click a control within the first page before selecting the
subsequent page, it paints correctly. In either case a further paint
fixes the problem.

If I set the WS_VISIBLE style in the initial Create() of the
SysListView32 it always paints correctly.


3. Custom Validator for a checkbox list control ?Strange behavior.

4. Strange behavior of RTL property of RichEdit controls

5. strange design-time control behavior

6. C5.5EE :: Strange Behavior with ActiveX Controls

7. Custom Validator for a checkbox list control ?Strange behavior.

8. Strange control behavior...

9. Strange Behaviour with MultiLine Textbox Control

10. ReportViewer Control's strange behaviour

11. how do i stop strange scroll behaviour on a user control

12. Very strange combo with tab control behavior -- additional bug?

13. Strange Behavior on Embedding a CMainFrame inside a managed tab control...

14. Combo Box Control Strange Behavior

15. strange behaviour of Control properties