Odd issue while reading checkbox stateCan HTML checkboxes be set to readonly?Setting “checked” for a checkbox with jQuery?How to check whether a checkbox is checked in jQuery?Check if checkbox is checked with jQueryGet checkbox value in jQueryHow to style a checkbox using CSS?Testing if a checkbox is checked with jQueryHow to create an HTML checkbox with a clickable labeljquery set checkbox checkedJavafx: How to implement 3-state checkboxes inside a TreeTableView

What is the philosophical significance of speech acts/implicature?

can anyone help me with this awful query plan?

Is Diceware more secure than a long passphrase?

555 timer FM transmitter

Does tea made with boiling water cool faster than tea made with boiled (but still hot) water?

Rivers without rain

How to limit Drive Letters Windows assigns to new removable USB drives

How to denote matrix elements succinctly?

Aligning equation numbers vertically

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

Like totally amazing interchangeable sister outfits II: The Revenge

How much cash can I safely carry into the USA and avoid civil forfeiture?

a sore throat vs a strep throat vs strep throat

Contradiction proof for inequality of P and NP?

Is it idiomatic to construct against `this`

Which big number is bigger?

On The Origin of Dissonant Chords

How do I reattach a shelf to the wall when it ripped out of the wall?

"You've called the wrong number" or "You called the wrong number"

Elements other than carbon that can form many different compounds by bonding to themselves?

Checks user level and limit the data before saving it to mongoDB

What happened to Captain America in Endgame?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?



Odd issue while reading checkbox state


Can HTML checkboxes be set to readonly?Setting “checked” for a checkbox with jQuery?How to check whether a checkbox is checked in jQuery?Check if checkbox is checked with jQueryGet checkbox value in jQueryHow to style a checkbox using CSS?Testing if a checkbox is checked with jQueryHow to create an HTML checkbox with a clickable labeljquery set checkbox checkedJavafx: How to implement 3-state checkboxes inside a TreeTableView






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have a checkbox column in a datagridview.When I try to iterate through the column,the results vary on each iteration despite no changes in the checkboxes.The following is the code:




Dim TotalRows As Integer = 0



 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
MsgBox(DGVMulyo.Rows(RW).Cells(1).Value)
If DGVMulyo.Rows(RW).Cells(1).Value = True Then
TotalRows = TotalRows + 1
End If
Next



On each iteration of the loop,the messagebox will show differing results of the state of the checkboxes.Some times even if the checkbox is checked,the output is shown as 0.
I also tried the following but the same issue persisted:




 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
MsgBox(DGVMulyo.Rows(RW).Cells(1).State)
If DGVMulyo.Rows(RW).Cells(1).State = True Then
TotalRows = TotalRows + 1
End If
Next



In the end,the following code seems to work reliably:




Dim TotalRows As Integer = 0



 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
'MsgBox(DGVMulyo.Rows(RW).Cells(1).Value)
If DGVMulyo.Rows(RW).Cells(1).Value = True Or DGVMulyo.Rows(RW).Cells(1).Value = 1 Then
TotalRows = TotalRows + 1
End If
' MsgBox(TotalRows)
Next



I am using VS-2017 Community edition with Windows-7 32 Bit OS.



Khalid.










share|improve this question






















  • It seems you've already solved your problem. What is your question?

    – TinkerTenorSoftwareGuy
    Mar 22 at 17:33











  • Problem is solved but why should I even need to use two conditions of True or 1 to get a reliable report.Normally only of these two is sufficient to get the correct result.Is this a bug in Visual Studio?

    – Khalid Kagzi
    Mar 22 at 17:35











  • We'd need to know more about your data in your cells to answer that question.

    – TinkerTenorSoftwareGuy
    Mar 22 at 20:42











  • How would the data in other cells/rows affect the result of a scan of the checkbox column.The checkbox column does not have any other data. However,I suspect that another action of mine might have resulted in this strange problem.I have written a code wherein,just by clicking in the row of an adjacent column,the checkbox of that row gets checked.That is,I set it to True.This might be the reason that those checkboxes which have been checked by setting to True are returning True and those checked directly are returning a value of 1.

    – Khalid Kagzi
    Mar 23 at 16:33


















0















I have a checkbox column in a datagridview.When I try to iterate through the column,the results vary on each iteration despite no changes in the checkboxes.The following is the code:




Dim TotalRows As Integer = 0



 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
MsgBox(DGVMulyo.Rows(RW).Cells(1).Value)
If DGVMulyo.Rows(RW).Cells(1).Value = True Then
TotalRows = TotalRows + 1
End If
Next



On each iteration of the loop,the messagebox will show differing results of the state of the checkboxes.Some times even if the checkbox is checked,the output is shown as 0.
I also tried the following but the same issue persisted:




 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
MsgBox(DGVMulyo.Rows(RW).Cells(1).State)
If DGVMulyo.Rows(RW).Cells(1).State = True Then
TotalRows = TotalRows + 1
End If
Next



In the end,the following code seems to work reliably:




Dim TotalRows As Integer = 0



 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
'MsgBox(DGVMulyo.Rows(RW).Cells(1).Value)
If DGVMulyo.Rows(RW).Cells(1).Value = True Or DGVMulyo.Rows(RW).Cells(1).Value = 1 Then
TotalRows = TotalRows + 1
End If
' MsgBox(TotalRows)
Next



I am using VS-2017 Community edition with Windows-7 32 Bit OS.



Khalid.










share|improve this question






















  • It seems you've already solved your problem. What is your question?

    – TinkerTenorSoftwareGuy
    Mar 22 at 17:33











  • Problem is solved but why should I even need to use two conditions of True or 1 to get a reliable report.Normally only of these two is sufficient to get the correct result.Is this a bug in Visual Studio?

    – Khalid Kagzi
    Mar 22 at 17:35











  • We'd need to know more about your data in your cells to answer that question.

    – TinkerTenorSoftwareGuy
    Mar 22 at 20:42











  • How would the data in other cells/rows affect the result of a scan of the checkbox column.The checkbox column does not have any other data. However,I suspect that another action of mine might have resulted in this strange problem.I have written a code wherein,just by clicking in the row of an adjacent column,the checkbox of that row gets checked.That is,I set it to True.This might be the reason that those checkboxes which have been checked by setting to True are returning True and those checked directly are returning a value of 1.

    – Khalid Kagzi
    Mar 23 at 16:33














0












0








0








I have a checkbox column in a datagridview.When I try to iterate through the column,the results vary on each iteration despite no changes in the checkboxes.The following is the code:




Dim TotalRows As Integer = 0



 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
MsgBox(DGVMulyo.Rows(RW).Cells(1).Value)
If DGVMulyo.Rows(RW).Cells(1).Value = True Then
TotalRows = TotalRows + 1
End If
Next



On each iteration of the loop,the messagebox will show differing results of the state of the checkboxes.Some times even if the checkbox is checked,the output is shown as 0.
I also tried the following but the same issue persisted:




 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
MsgBox(DGVMulyo.Rows(RW).Cells(1).State)
If DGVMulyo.Rows(RW).Cells(1).State = True Then
TotalRows = TotalRows + 1
End If
Next



In the end,the following code seems to work reliably:




Dim TotalRows As Integer = 0



 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
'MsgBox(DGVMulyo.Rows(RW).Cells(1).Value)
If DGVMulyo.Rows(RW).Cells(1).Value = True Or DGVMulyo.Rows(RW).Cells(1).Value = 1 Then
TotalRows = TotalRows + 1
End If
' MsgBox(TotalRows)
Next



I am using VS-2017 Community edition with Windows-7 32 Bit OS.



Khalid.










share|improve this question














I have a checkbox column in a datagridview.When I try to iterate through the column,the results vary on each iteration despite no changes in the checkboxes.The following is the code:




Dim TotalRows As Integer = 0



 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
MsgBox(DGVMulyo.Rows(RW).Cells(1).Value)
If DGVMulyo.Rows(RW).Cells(1).Value = True Then
TotalRows = TotalRows + 1
End If
Next



On each iteration of the loop,the messagebox will show differing results of the state of the checkboxes.Some times even if the checkbox is checked,the output is shown as 0.
I also tried the following but the same issue persisted:




 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
MsgBox(DGVMulyo.Rows(RW).Cells(1).State)
If DGVMulyo.Rows(RW).Cells(1).State = True Then
TotalRows = TotalRows + 1
End If
Next



In the end,the following code seems to work reliably:




Dim TotalRows As Integer = 0



 For RW As Integer = 0 To DGVMulyo.Rows.Count - 1
'MsgBox(DGVMulyo.Rows(RW).Cells(1).Value)
If DGVMulyo.Rows(RW).Cells(1).Value = True Or DGVMulyo.Rows(RW).Cells(1).Value = 1 Then
TotalRows = TotalRows + 1
End If
' MsgBox(TotalRows)
Next



I am using VS-2017 Community edition with Windows-7 32 Bit OS.



Khalid.







checkbox






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 17:17









Khalid KagziKhalid Kagzi

13




13












  • It seems you've already solved your problem. What is your question?

    – TinkerTenorSoftwareGuy
    Mar 22 at 17:33











  • Problem is solved but why should I even need to use two conditions of True or 1 to get a reliable report.Normally only of these two is sufficient to get the correct result.Is this a bug in Visual Studio?

    – Khalid Kagzi
    Mar 22 at 17:35











  • We'd need to know more about your data in your cells to answer that question.

    – TinkerTenorSoftwareGuy
    Mar 22 at 20:42











  • How would the data in other cells/rows affect the result of a scan of the checkbox column.The checkbox column does not have any other data. However,I suspect that another action of mine might have resulted in this strange problem.I have written a code wherein,just by clicking in the row of an adjacent column,the checkbox of that row gets checked.That is,I set it to True.This might be the reason that those checkboxes which have been checked by setting to True are returning True and those checked directly are returning a value of 1.

    – Khalid Kagzi
    Mar 23 at 16:33


















  • It seems you've already solved your problem. What is your question?

    – TinkerTenorSoftwareGuy
    Mar 22 at 17:33











  • Problem is solved but why should I even need to use two conditions of True or 1 to get a reliable report.Normally only of these two is sufficient to get the correct result.Is this a bug in Visual Studio?

    – Khalid Kagzi
    Mar 22 at 17:35











  • We'd need to know more about your data in your cells to answer that question.

    – TinkerTenorSoftwareGuy
    Mar 22 at 20:42











  • How would the data in other cells/rows affect the result of a scan of the checkbox column.The checkbox column does not have any other data. However,I suspect that another action of mine might have resulted in this strange problem.I have written a code wherein,just by clicking in the row of an adjacent column,the checkbox of that row gets checked.That is,I set it to True.This might be the reason that those checkboxes which have been checked by setting to True are returning True and those checked directly are returning a value of 1.

    – Khalid Kagzi
    Mar 23 at 16:33

















It seems you've already solved your problem. What is your question?

– TinkerTenorSoftwareGuy
Mar 22 at 17:33





It seems you've already solved your problem. What is your question?

– TinkerTenorSoftwareGuy
Mar 22 at 17:33













Problem is solved but why should I even need to use two conditions of True or 1 to get a reliable report.Normally only of these two is sufficient to get the correct result.Is this a bug in Visual Studio?

– Khalid Kagzi
Mar 22 at 17:35





Problem is solved but why should I even need to use two conditions of True or 1 to get a reliable report.Normally only of these two is sufficient to get the correct result.Is this a bug in Visual Studio?

– Khalid Kagzi
Mar 22 at 17:35













We'd need to know more about your data in your cells to answer that question.

– TinkerTenorSoftwareGuy
Mar 22 at 20:42





We'd need to know more about your data in your cells to answer that question.

– TinkerTenorSoftwareGuy
Mar 22 at 20:42













How would the data in other cells/rows affect the result of a scan of the checkbox column.The checkbox column does not have any other data. However,I suspect that another action of mine might have resulted in this strange problem.I have written a code wherein,just by clicking in the row of an adjacent column,the checkbox of that row gets checked.That is,I set it to True.This might be the reason that those checkboxes which have been checked by setting to True are returning True and those checked directly are returning a value of 1.

– Khalid Kagzi
Mar 23 at 16:33






How would the data in other cells/rows affect the result of a scan of the checkbox column.The checkbox column does not have any other data. However,I suspect that another action of mine might have resulted in this strange problem.I have written a code wherein,just by clicking in the row of an adjacent column,the checkbox of that row gets checked.That is,I set it to True.This might be the reason that those checkboxes which have been checked by setting to True are returning True and those checked directly are returning a value of 1.

– Khalid Kagzi
Mar 23 at 16:33













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304765%2fodd-issue-while-reading-checkbox-state%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55304765%2fodd-issue-while-reading-checkbox-state%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript