Datagrid checkbox headerrenderer check off problem

I have a datagrid where one column has select option like what we have in mail inboxes. User can select one or many row items to perform any actions by selecting the checkbox. It has also one select all option which is shown in the header renderer of that particular column. If user clicks on that all checkboxes gets selected.
I have done that but the problem is that whenever i am performing any action by selecting all(header checkbox) and as a result the datagrid sometimes sets visible off or switches to some other mxml component from the component which is holding the datagrid and after coming back from that scenario again to the datagrid, its seen that the checkbox is still checked ... i want that checkbox to set to non-checked.
help me.

Hi subhajit nag,
Say the below is your mxml component in viewStack...
<your component>
<mx:Script>
<![CDATA[
[Bindable]private var headerChecked:Boolean = false;
private function onShow():void
     headerChecked = false;
]]>
</mx:Script>
</your component>
<mx:DataGrid x="35" y="10" id="mydg">
        <mx:columns>        
            <mx:DataGridColumn editable="true" sortable="false">
             <mx:headerRenderer>
              <mx:Component>
                        <mx:CheckBox selected="{outerDocument.headerChecked}" click="checkUnCheckCheckBoxes()">
                         <mx:Script>
                  <![CDATA[
                   import mx.collections.ArrayCollection;
               private function checkUnCheckCheckBoxes():void
                  // You can handle your logic what you want to do when header check box is clicked....   
                  ]]>
              </mx:Script>
                        </mx:CheckBox>
                    </mx:Component>
             </mx:headerRenderer>
                <mx:itemRenderer>                
                    <mx:Component>
                        <mx:CheckBox selected="{data.isSelected}" click="{data.recselected = !data.recselected}"/>
                    </mx:Component>
                </mx:itemRenderer>
            </mx:DataGridColumn>
            <mx:DataGridColumn headerText="Column 1" dataField="firstName"/>
            <mx:DataGridColumn headerText="Column 2" dataField="lastName"/>           
        </mx:columns>
    </mx:DataGrid>
So you just need to change the value of the headerChecked  bindable variable to false..in show event for your first scenario...and your header check box is automatically unselected because this check box is binded to a bindable variable to which you are setting to false...
For your second scenario....you can use the same changing the headerChecked value to false...
You need to set this varibale to false in your second scenario where you know that your Header Render datagrid is making it visible after you made it unvisible...
say you have clicked header check box and you made this datagrid invisible and this header checkbox datagrid will be visible once again when you click toggle button so set the value to false in the toggle button click function....
private function toggleButtonClickHandler():void
     headerChecked = false;
     yourHeaderChkDataGrid.visible = true;
     yourAnotherDG.visible = false;
Hope this is clear for you now...Try this and let me know...
Thanks,
Bhasker Chari

Similar Messages

  • Only allow datagridviewcheckbox to check off if it meets certain criteria.

    I have a datagridview with a checkbox column next to it. The datagridview holds a list of all open invoices for a given customer. I don't want the checkbox to check off if there is no money to apply to this invoice. Basically every time the checkbox is
    unchecked and the user is trying to check in the check box it should check if there is money to apply if yes then check it off if not then it should give a message that it can't check off.
    Debra has a question

    I have a datagridview with a checkbox column next to it. The datagridview holds a list of all open invoices for a given customer. I don't want the checkbox to check off if there is no money to apply to this invoice. Basically every time the checkbox
    is unchecked and the user is trying to check in the check box it should check if there is money to apply if yes then check it off if not then it should give a message that it can't check off.
    Debra has a question
    Hello,
    You could consider doing that task inside CellValidating event like the code below.
    private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
    { //make sure the cell belongs to the checkboxColumn
    if (e.ColumnIndex ==0 && e.RowIndex >-1 )
    { //check whether it meets certain criteria here
    if (Convert.ToInt32(this.dataGridView1.Rows[e.RowIndex].Cells["criteria"].Value) < 2)
    dataGridView1.CancelEdit();
    MessageBox.Show("It doesn't meet");
    The line dataGridView1.CancelEdit(); will stop the checking and return to original value.
    You could place the opinion with your line instaed.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Dynamically checking off checkboxes

    Hi,
    I have a simple form with some checkboxes.  The user checks them off and the values get store in a db.
    I like to eat:
    Form page:
      <input type="Checkbox" name="fruit" value="apples">apples ....
    - apples
    - oranges
    - bananas
    - grapes
    So on the edit page if the user has checked off all, but oranges it should be displayed from the db like so:
    x apples
    - oranges
    x bananas
    x grapes
    I started by doing this, but it doesn't quit cut it.  Maybe merging the values of the form fields and the db fields into one list would work?
    <cfoutput query="getinfo">
             <cfif fruit EQ '#fruit#'>
             <input type="Checkbox" name="fruit" value="#fruit#" checked>x apples
             <cfelse>
             <input type="Checkbox" name="fruit" value="#fruit#" >apples
    </cfoutput>
    Any ideas would be much appreciated!

    Database table: fruitChoice
    userID apple orange banana grape
    x147d
    1
    0
    1
    1
    a065b
    0
    1
    1
    1
    t992w
    1
    0
    1
    0
    Query to fetch data from the database:
    <cfquery name="getInfo" datasource="myDSN">
    select apple,orange,banana,grape
    from fruitChoice
    where userID = '#session.userID#'
    </cfquery>
    Query to insert data into the database:
    <!--- I use the submit field, not a checkbox, to verify whether the form has been submitted. If you don't check a checkbox, x, then the variable form.x wont exist when the form is submitted --->
    <cfif isDefined("form.sbmt")>
    <cfset isAppleChosen=0>
    <cfset isOrangeChosen=0>
    <cfset isBananaChosen=0>
    <cfset isGrapeChosen=0>
    <cfif isDefined("form.apples")>
        <cfset isAppleChosen=1>
    </cfif>
    <cfif isDefined("form.oranges")>
        <cfset isOrangeChosen=1>
    </cfif>
    <cfif isDefined("form.bananas")>
        <cfset isBananaChosen=1>
    </cfif>
    <cfif isDefined("form.grapes")>
        <cfset isGrapeChosen=1>
    </cfif>
    <cfquery name="saveInfo" datasource="myDSN">
    insert into fruitChoice (userID,apple,orange,banana,grape)
    values ('#session.userID#',#isAppleChosen#,#isOrangeChosen#,#isBananaChosen#,#isGrapeChosen#)
    </cfquery>
    </cfif>
    And, finally, the form
    <form>
        <p>
        <cfif getinfo.apple EQ 1>
            <input type="Checkbox" name="apples" checked>apples
        <cfelse>
            <input type="Checkbox" name="apples">apples
        </cfif>
        </p>
        <p>
        <cfif getinfo.orange EQ 1>
            <input type="Checkbox" name="oranges" checked>oranges
        <cfelse>
            <input type="Checkbox" name="oranges">oranges
        </cfif>
        </p>
        <p>
        <cfif getinfo.banana EQ 1>
            <input type="Checkbox" name="bananas" checked>bananas
        <cfelse>
            <input type="Checkbox" name="bananas">bananas
        </cfif>
        </p>
        <p>
        <cfif getinfo.grape EQ 1>
            <input type="Checkbox" name="grapes" checked>grapes
        <cfelse>
            <input type="Checkbox" name="grapes">grapes
        </cfif>
        </p>
        <p>
        <input type="submit" name="sbmt" value="send">
        </p>
    </form>

  • I am on OS X and i am having problems sending pictures from the new pictures app via email.  when i hit the sharing button i have the option to send via iMessage or Facebook but the email option is ghosted and can't be checked off.  any suggestions?

    I am on OS X and i am having problems sending pictures from the new pictures app via email.  when i hit the sharing button i have the option to send via iMessage or Facebook but the email option is ghosted and can't be checked off.  any suggestions?

    I've resolved my problem now.  It wasn't iphoto: preferences:@ that I needed but iphoto:preferences:general where there is the option to choose email for sending photos.  Can't believe I missed that before.

  • In Acrobat, I wrote a script to turn fields gray if a checkbox was checked. How can I get it to reset to white (or clear) when the reset form button is clicked?

    In Acrobat, I wrote a script to turn fields gray if a checkbox was checked. How can I get it to reset to white (or clear) when the reset form button is clicked?

    Thank you so much for your reply . . . but . . . I should have shared my original script with you -- it was a little more complicated than I led you to believer. I was triggering a group of text fields to become disabled as well as gray. Below is the original script so that when the checkbox is checked, it causes several "Co" fields to be disabled and gray.
    // Mouse Up script for check box 
    // If checked, certain fields should be disabled 
    var f_prefix = "Co"; 
    // Get a reference to all of the "Co" fields 
    var f = getField(f_prefix); 
    // Reset the Co fields 
    resetForm([f_prefix]); 
    if (event.target.value === "Off") { 
        // Enable the Co fields 
        f.readonly = false; 
        f.fillColor = color.transparent; 
    } else { 
        // Disable the Co fields 
        f.readonly = true; 
        f.fillColor = color.gray; 
    To recap -- my goal is to get those gray fields to revert to transparent if the form is reset. I'm willing to create my own custom "Reset Form" button but I'm not sure I understand how that would look. Wouldn't it be quite lengthy? I think I'm having a brain freeze -- can't figure it out!

  • What to write query to get know if a checkbox is checked

    hello,
    I have created a checkbox with name Entertainment containing static values Movie,Play,music.
    Now i have to write query to check which value of checkbox is checked ,means play or movie or music.
    According to that i have to mail a particular link to a user.
    I have seen in how to (checkbox help) but not getting it.
    please anyone can help me out.

    HI marc,
    I think so u are not able to get my problem,i will explain it in detail.
    I have a table USERINFO which has variables of type varchar2,these variable are used as a checkbox on page name 'ENTER INFORMATION',these checkbox have some static values,every time a user checks checkbox values it get stored in database,suppose there is a checkbox name sport with static values cricket,football,now if any user select cricket this value get stored in database with username ,mailid.
    Now i have a page on this i want to give user facility to enter name of checkbox to create and its corresponding static values,and these checkbox should get display on page 'ENTER INFORMATION'and a variable of type varchar2() with checkbox name should get create in tableUSERINFO .
    now can u suggest me how can i achieve this.

  • How to check if a checkbox is checked

    Hello,
    I have got the following problem. I have got a page with three checkboxes and just want to check when i click a button at the end of the page if one of these checkboxes is checked and set a coresponding variable in the sessionbean to remember this. I imported the projekt from creator 1 where you could check this with the checkbox.isSelected() method in creator 2 this should be the checkbox.isChecked() method but he just wont set my value when i click the button at the end of the page. I already tried to move the isChecked method into the valueprocesschange method or the actionevent for the button (where it belongs) but nothing helps. Have you any suggestions what i could be making wrong?
    Thanks in advance for help
    Acinonyx

    Try
    checkbox1.getSelected()
    this is the function that works in JSC 2.

  • Spaces not appearing on menubar -- even if checked off in preferences to

    "Spaces" is no longer appearing in the menubar, although checked off in system preferences to do so.
    I have tried shutting down spaces and restarting, but this does not help.
    I do not have yahoo gadgets that have been listed on the support page to cause this type of problem.
    No other items have no appeared on the menubar.
    Suggestions?
    (Many thanks in advance)

    Hi rl68, and a warm welcome to the forums!
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then...
    Apple Menu Bar Icons Gone
    You've probably got a couple of corrupt preference files.
    In "/Users/<yourname>/Library/Preferences", delete com.apple.systemuiserver.plist
    In "/Users/<yourname>/Library/Preferences/ByHost", delete com.apple.systemuiserver.xxx.plist where 'xxx' is a 12 digit (hexadecimal) numeric string.
    This will reset your Menu Bar to the default, you'll need to go through System Preferences to reset the ones you need. (If they are already checked, uncheck them first and then recheck them).

  • JSTL test if checkbox is checked

    Hello all,
    I hope this question isn't too amateurish to answer, but it is something that has been troubling me.
    I have a table with two columns. In the first column i've got a form checkbox with id="myCheckbox" and in the second column I have a bit of text that I only want displayed if the checkbox is checked. I mostly had this working through a combination of a small javascript function that was set to the onclick parameter of the checkbox to toggle between hiding and displaying the text while having the text initialize to not be displayed (with style="display:none")...
    ...but the problem was that if there was an error being returned in the form, the page would reload with the text hidden, but the checkbox checked. Now I could get around this by re-initializing the checkbox to being unchecked... but that's not the solution i'm looking for. Ideally, if an error were returned and the page reloaded I would like the checkbox to be checked and the text to be displayed.
    I was hoping that perhaps I could use some JSTL magic to form a statement around the text... something to the effect of <c:if test="${myCheckbox.checked}"> display text </c:if> . But that isn't working for me. Am I close in my thinking? I think my thinking is mostly good, it's the implementation that is not good. Is there any way to perform such a test?
    Let me know if anyone can help... thanks,
    Skylar

    Hmm, that is helpful, but it doesn't get me quite there.
    I was unfamiliar with the "not empty param" test, so thank you. As I suspected after reading your post, however, the parameter is not set until the form is submitted. I think I may have to either use a combo of your suggestion along with my previous javascript function... or add additional functionality to my script to maintain state between page reloads.
    Does this make sense? Again, thanks evnafets.Let me know if you (or anyone else!) have any other ideas.

  • Check print Problem  - F110

    Hi,
    Automatic payment program run was carried out in the last week through F110. It was observed that 56 payment documents has been generated, but due to check lot problem, only 12 checks has been issued and the programe was terminated due to insufficinent checks.
    I would like to assign new check lot number for the above doucments for which checks not issued.
    Let me know what is the procedure 
    Thanks & Regards,
    Prasad

    Hi,
    Reprint Check (FCH7).
    Procedure
    1.       Start the transaction using the transaction code FCH7.  The Reprint Check screen appears.
    2.       As required, complete/review the following fields:
    ·         Paying company code
    ·         House bank
    ·         Account ID
    ·         Check Number
    ·         Void reason code
    ·         Check lot number
    ·         Alternative form
    ·         Padding Character
    ·         Printer for forms
    ·         Payment advice printer
    3.       Select the checkbox  to the left of Print Immediately.
    Assign points if you find this helpful.
    Zia

  • Reminders- Unable to check off recurring tasks as completed on my iMac

    I have a weird question.  I use reminders on my iMac (located in Calendar), on my iPhone and iPad.  It is all syncing nicely with iCloud, however I am unable to check-off items completed that are recurring (for instance made the house payment) on my iMac ONLY.  In other words, I am able to check these items off on my iPhone or my iPad and then it is removed and renewed for the next month on my iMac when I do so but I cannot do this for some reason on my iMac.  I can check off non-recurring items on my iMac without a problem. 
    Any suggestions? 

    Same issue here.  If I check them off via iCloud.com (on Mac or Windows PC) they disappear completely.  If I check them off from iPhone/iPad, the "current" one marks complete and the next occurance shows up as expected.
    Apple -- please fix this bug!

  • Make field editable when checkbox is checked, otherwise given read-only value

    I'm attempting to make a fillable PDF form, from and existing document, using  Acrobat Pro that does the following:
    Purpose of form is to provide customer a way to agree to purchase a custom artwork.
    The artwork has a base price, ArtworkPrice. (The ArtworkPrice field is editable)
    The customer can choose to include a picture frame. (AddFrame checkbox 'Yes'.)
    Choosing 'Yes' to add a frame adds an amount.  (The FramePrice field is editable only if AddFrame checkbox is checked)
    Otherwise, Leaving AddFrame unchecked fills the FramePrice field with a value of 0.00.
    The TotalPrice is calculated as the sum of the ArtworkPrice and the FramePrice fields. (The TotalPrice field is read-only)
    So...this part of the form looks essentially of like this:
    AddFrame? [  ] Yes
    ArtworkPrice $__________   +  FramePrice $__________ = TotalPrice $__________
    The FramePrice field must be 0.00 (and not editable) at all times unless the AddFrame checkbox is selected.
    How can I do this?

    Add this code to the MouseUp event of AddFrame:
    if (this.getField("AddFrame").value=="Off") {
    this.getField("FramePrice").value = 0;
    this.getField("FramePrice").readonly = true;
    } else {
    this.getField("FramePrice").value = "";
    this.getField("FramePrice").readonly = false;

  • MOVED: K7N2 Delta Upgrade Power Off Problems

    This topic has been moved to AMD SocketA based board.
    K7N2 Delta Upgrade Power Off Problems

    Thanks for the various suggestions.  I can confirm:
     - 4 pin cpu power plug connected
     - front bus frequency changed to 200MHz, processor now recognised correctly as Athlon xp3200+
     - I have been assured the cpu has not been overclocked
    However power off problem persists.  System shuts down after approx 1 minute whether i am in BIOS or start initiaiting xp repair from CD.  As the system shuts down after such a short time the xp repair will not complete. The system wil not power on again until at least 15mins has elapsed then promptly powers off again.
     I have fitted the D-bracker diagnostic tool and this shows 'operating system booting', ie four green lights.
    I note from the motherboard maunal that a cpu thermal protection system is installed for the Athlon cpu platform.  If the mechanism senses an abnormal temperature rise it automatically shuts down the system.  As noted in my original post the system is powering off with the cpu temp at <40 deg C.  The cpu warning temp in the BIOS PC health check stsus facility is set at 60 deg C so do not think this is the issue?
    System details:
    MSI K7 N2 delta (MS-6570)
    Athlon xp 3200+ (AXDA3200DKV-4E)
    Corsair twinX 1024-3200C2 DDR-DIM 1024 MB
    Seagate ST340016A 40MB HDD
    Pioneer DVD Rom
    Generic CRD - BP1500P CD
    1.4MB mitsumi FDD
    Thermal take TR2 470W psu
    Coolermaster xdreamII socket A cpu fan
    Gigabyte geforce 6600GT turbo video
    soundblaster live 5.1
    Anyone any further thoughts?

  • MSI K7N2 Delta-ILSR, Mouse problem & Video off problem solved!!!

    I find the following information that I collected very interesting at the very least...
    Here goes...
    The video off problem that I was having was directly linked to the mouse. Here, let me explain the video off problem. In the BIOS Have the Standby mode set to S3. The problem occurred when I started windows, then went into standby, then started back up, then restarted the computer, the monitor would act as if it were in sleep mode, or rather there was no signal being sent to the monitor. Well the odd way I fixed that is by plugging in a standard 2 button PS/2 mouse. Also this fixed the issue with the mouse sometimes not working in windows.
    Here is how I tested.
    Logitech MX700 Cordless Optical Mouse, PS/2 & USB= failed.
    Logitech iFeel Optical Mouse, USB= failed.
    Microsoft Cordless Ball Mouse, PS/2= failed.
    Standard Artec (Cheapy brand) Ball Mouse (With no wheel), PS/2= All issues fixed, and passed.
    When I said failed I do not mean they didn't work, I mean they sometimes didn't work and also caused the Video off problem after restarting the computer.
    Obviously it isn't the ports (PS/2 or USB) that are the problem, it is more like the mouse itself, and the amount of buttons in particular. As you can see above the only mouse that works correctly is the one that only has 2 buttons, the rest has 3 or more buttons along with a Wheel. The MX700 has 8 buttons + wheel, WOW!
    Anyways I figure out it was the mouse, and not the memory.
    Obviously MSI needs to make a patch for this mouse problem.
    I'm still having a hard time believing that the mouse caused the video not to work, but it is true! I spend well over 5 hours testing this crap. Every time with the mice with more then 3 buttons it messed up, and every time with the 2 button old fashion mouse it worked flawlessly!
    MSI, get to work on a new BIOS to fix this mess!!!  :]
    BioHaz

    Quote
    Originally posted by Raven_
    hi
    its possible to use an ps/2 mouse AND a usb mouse at the same time.
    i used the ps/2 mouse in windows and the usb mouse when playing games.
    you can get some trouble if you do it the way i did it.
    i was in windows surfing and the pointer just jumped all over the screen.
    when i looked on the other side under a table a friends little kid played with the usn mouse.  )
    bye
    LOL, that isn't what I'm talking about.
    There seems to be a problem with my motherboard accepting mice with more then 2 buttons. It works the first time, but if you restart the computer, the video goes off. If you have both installed, it still messed up.
    BioHaz

  • I added a contact to my iphone 4s and when I did a sync manually it is not showing up on my MAC in address book - please help....I checked off sync all contacts in iTunes  - does it only work one way from computer to phone?

    I added a contact to my iphone 4s and when I did a sync manually it is not showing up on my MAC in address book - please help....I checked off sync all contacts in iTunes  - does it only work one way from computer to phone?

    Is it because the new itunes looks different.
    View > Show Sidebar
    Then it should work just the same as on your old computer.

Maybe you are looking for

  • CS4- properties panel not displayed correctly

    I just installed Dreamweaver v10.  The properties panel information is being clipped. Does anyone else have this problem?

  • Sound Out on 24" imac

    Does anyone know if the headphone jack out on the 24" imac puts out has a stronger signal than say the 20" imac. It has a more powerful amp inside, almost twice the power from what I have read. Does this power get to the headphone jack or is this a s

  • How to generate item codes automatically

    Hi, My customer wants that the inventory item code be generated automatically based on its description. The code should have: - 3 first characters of the description - A sequential increased number, to make the code unique. e.g. the item called "Petr

  • Web services @ SAP MDM

    Hello Experts, What is the use of web services for SAP MDM?? And how can we achive it!!! Can anyone take sometime in explaining it  in simple words.. Thanks in advance. Kind Regards Eva

  • Left USB on MacBook Pro not working.

    I've got a brand new MacBook pro unibody (not the one from WWDC though, I have the one with the removable battery (late 2008 I guess) and the left USB port which is closest to the firewire port doesn't work. The computer is only 3 weeks old and I can