I can't seem to get my checkboxes to get checked for some reason.
I have 2 Datagrids and they are named Datagrid1 and Datagrid2.
My code is:
************************************************** *****************************
theGrid = DataGrid1
if (sendor.id = "CheckAll2") or (sendor.id = "UnCheckAll2") then theGrid =
DataGrid2
for each oItem as DataGridItem in theGrid.items
theCheckBox = CType(oItem.FindControl("FullNameCheckBox"),CheckB ox)
if (sendor.id = "CheckAll1") or (sendor.id = "CheckAll2") then
trace.warn("Setting Check to true theGrid.id = " & theGrid.id)
theCheckBox.Checked = true
else
theCheckBox.Checked = false
end if
Next
************************************************** *****************************
The trace shows I am setting the control and am pointing at the correct
datatgrid. I normally don't have a problem setting the checkbox when
setting it from a value out of my Sql Statement.
Why doesn't this work?
Thanks,
Tom. 4 1245
Tom do you mean when u try to check them they are not ticked?
Patrick
"tshad" <ts**********@ftsolutions.com> wrote in message
news:uL**************@TK2MSFTNGP14.phx.gbl... I can't seem to get my checkboxes to get checked for some reason.
I have 2 Datagrids and they are named Datagrid1 and Datagrid2.
My code is:
************************************************** **************************
*** theGrid = DataGrid1 if (sendor.id = "CheckAll2") or (sendor.id = "UnCheckAll2") then theGrid
= DataGrid2
for each oItem as DataGridItem in theGrid.items theCheckBox = CType(oItem.FindControl("FullNameCheckBox"),CheckB ox) if (sendor.id = "CheckAll1") or (sendor.id = "CheckAll2") then trace.warn("Setting Check to true theGrid.id = " & theGrid.id) theCheckBox.Checked = true else theCheckBox.Checked = false end if Next
************************************************** **************************
*** The trace shows I am setting the control and am pointing at the correct datatgrid. I normally don't have a problem setting the checkbox when setting it from a value out of my Sql Statement.
Why doesn't this work?
Thanks,
Tom.
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:up**************@TK2MSFTNGP15.phx.gbl... Tom do you mean when u try to check them they are not ticked?
Not really. What seemed to be happening was that they were showing on the
screen as not being checked (ticked).
I actually found the problem a few minutes ago.
They were getting set and then cleared cleared when I rebound the grid and
hadn't realized that was happening. I didn't realize that that would reset
the checkboxes.
Thanks,
Tom Patrick
"tshad" <ts**********@ftsolutions.com> wrote in message news:uL**************@TK2MSFTNGP14.phx.gbl... I can't seem to get my checkboxes to get checked for some reason.
I have 2 Datagrids and they are named Datagrid1 and Datagrid2.
My code is:
************************************************** ************************** *** theGrid = DataGrid1 if (sendor.id = "CheckAll2") or (sendor.id = "UnCheckAll2") then theGrid = DataGrid2
for each oItem as DataGridItem in theGrid.items theCheckBox = CType(oItem.FindControl("FullNameCheckBox"),CheckB ox) if (sendor.id = "CheckAll1") or (sendor.id = "CheckAll2") then trace.warn("Setting Check to true theGrid.id = " & theGrid.id) theCheckBox.Checked = true else theCheckBox.Checked = false end if Next ************************************************** ************************** *** The trace shows I am setting the control and am pointing at the correct datatgrid. I normally don't have a problem setting the checkbox when setting it from a value out of my Sql Statement.
Why doesn't this work?
Thanks,
Tom.
So what was your solution.?
Did u check for the Postback?
"tshad" <ts**********@ftsolutions.com> wrote in message
news:ur**************@TK2MSFTNGP12.phx.gbl... "Patrick.O.Ige" <na********@hotmail.com> wrote in message news:up**************@TK2MSFTNGP15.phx.gbl... Tom do you mean when u try to check them they are not ticked? Not really. What seemed to be happening was that they were showing on the screen as not being checked (ticked).
I actually found the problem a few minutes ago.
They were getting set and then cleared cleared when I rebound the grid and hadn't realized that was happening. I didn't realize that that would
reset the checkboxes.
Thanks,
Tom Patrick
"tshad" <ts**********@ftsolutions.com> wrote in message news:uL**************@TK2MSFTNGP14.phx.gbl... I can't seem to get my checkboxes to get checked for some reason.
I have 2 Datagrids and they are named Datagrid1 and Datagrid2.
My code is:
************************************************** ************************** *** theGrid = DataGrid1 if (sendor.id = "CheckAll2") or (sendor.id = "UnCheckAll2") then theGrid = DataGrid2
for each oItem as DataGridItem in theGrid.items theCheckBox = CType(oItem.FindControl("FullNameCheckBox"),CheckB ox) if (sendor.id = "CheckAll1") or (sendor.id = "CheckAll2") then trace.warn("Setting Check to true theGrid.id = " & theGrid.id) theCheckBox.Checked = true else theCheckBox.Checked = false end if Next
************************************************** ************************** *** The trace shows I am setting the control and am pointing at the correct datatgrid. I normally don't have a problem setting the checkbox when setting it from a value out of my Sql Statement.
Why doesn't this work?
Thanks,
Tom.
I just took out the rebind of the Grid (which was on the postback) and it
worked fine.
Thanks,
Tom
"Patrick.O.Ige" <pa********@optusnet.com.au> wrote in message
news:eQ**************@TK2MSFTNGP12.phx.gbl... So what was your solution.? Did u check for the Postback? "tshad" <ts**********@ftsolutions.com> wrote in message news:ur**************@TK2MSFTNGP12.phx.gbl... "Patrick.O.Ige" <na********@hotmail.com> wrote in message news:up**************@TK2MSFTNGP15.phx.gbl... > Tom do you mean when u try to check them they are not ticked?
Not really. What seemed to be happening was that they were showing on the screen as not being checked (ticked).
I actually found the problem a few minutes ago.
They were getting set and then cleared cleared when I rebound the grid and hadn't realized that was happening. I didn't realize that that would reset the checkboxes.
Thanks,
Tom > Patrick > > "tshad" <ts**********@ftsolutions.com> wrote in message > news:uL**************@TK2MSFTNGP14.phx.gbl... >> I can't seem to get my checkboxes to get checked for some reason. >> >> I have 2 Datagrids and they are named Datagrid1 and Datagrid2. >> >> My code is: >> >> > ************************************************** ************************** > *** >> theGrid = DataGrid1 >> if (sendor.id = "CheckAll2") or (sendor.id = "UnCheckAll2") then >> theGrid > = >> DataGrid2 >> >> for each oItem as DataGridItem in theGrid.items >> theCheckBox = CType(oItem.FindControl("FullNameCheckBox"),CheckB ox) >> if (sendor.id = "CheckAll1") or (sendor.id = "CheckAll2") then >> trace.warn("Setting Check to true theGrid.id = " & theGrid.id) >> theCheckBox.Checked = true >> else >> theCheckBox.Checked = false >> end if >> Next >> > ************************************************** ************************** > *** >> >> The trace shows I am setting the control and am pointing at the >> correct >> datatgrid. I normally don't have a problem setting the checkbox when >> setting it from a value out of my Sql Statement. >> >> Why doesn't this work? >> >> Thanks, >> >> Tom. >> >> > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ceema M via DotNetMonster.com |
last post by:
Hello all,
I have a nested repeater, which displays categories(parent repeater) and
corresponding subcategories(child repeater). Both repeaters have checkboxes.
When I check category checkbox...
|
by: Steven |
last post by:
How can I disable the ThreeState of a checkbox in a datagrid datacolumn
(dataset)?
Because of the ThreeState the checkboxes in my datagrid can be in the states
'Checked', 'Unchecked', and...
|
by: jim.long |
last post by:
I can't seem to get the checked value from the checkboxes! Is there
something wrong with the code? It loops through the repeater item
collection correctly.
HTML:
<asp:repeater id="rPrinterJobs"...
|
by: Chuck Anderson |
last post by:
My knowledge of JavaScript is limited. I learn from example and then
adapt those examples to suit my needs.
I have stumped myself on this one.
I have a form with checkboxes that I want to...
|
by: Amer Neely |
last post by:
I've got a dynamically built form with checkboxes for each element ( a
list of file names in a directory). I need to grab only those checkboxes
that are checked, so I can then delete those files.
...
|
by: LionsDome |
last post by:
Hello,
I have a vb.net page which a bunch of checkboxes. A user can select a
checkbox(s) and hit the submit button to store those values in a SQL
Server table. This works fine with no problem...
|
by: TechnoAtif |
last post by:
<?php
include "dbconnect.php";
include "commonFunc.php"; ?>
<!---------------------------------->
<table width="80%" border="1" cellpadding="2" cellspacing="0">
<tr >
<td...
|
by: runway27 |
last post by:
i am using a self submitting form
<form action="<?php echo $_SERVER; ?>" method="POST" id="test2" name="test1">
i need to do a validation of textfields, checkboxes, radio buttons
i am able...
|
by: realin |
last post by:
Hiya all,
i am in deep trouble, i thought it was an easy task, but now its getting on my nerves.
Well i have a div on a form, which contains a number of checkboxes, as
<div...
|
by: iderocks |
last post by:
Hi All,
I created a dynamic checkbox in ASP .Net inside a Button1_Click event method (outside the page_load event) and performed the event handling method for the CheckedChanged event and when I...
|
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...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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...
|
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...
| |