Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radio Button #301

Closed
mohaprog opened this issue Nov 25, 2018 · 2 comments
Closed

Radio Button #301

mohaprog opened this issue Nov 25, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@mohaprog
Copy link

I am trying to change the radioButton state by using xlsx.setCellValue in his linked cell but it show always 0.

Code :

xlsx.SetCellValue("test", "K45", 1)

Result :
image

The radio Buttons already exist in the excel file. I need to update the state.

Thank you

@xuri xuri added the confirmed This issue can be reproduced label Nov 26, 2018
@xuri
Copy link
Member

xuri commented Nov 26, 2018

Thanks for your issue. The excelize library doesn't support change the radio button by set cell value currently, x:ClientData element in the xl/drawings/vmlDrawing%d.vml hasn't been maintained yet completely.

@xuri xuri added enhancement New feature or request and removed confirmed This issue can be reproduced labels Dec 14, 2018
@xuri xuri closed this as completed in b667987 Jul 12, 2023
@xuri
Copy link
Member

xuri commented Jul 21, 2023

Thanks for your issue, and sorry for my late reply. I have initialized form control support for this library, please upgrade to the master branch code, and this feature will be released in the next version. Now we can delete the form control and add a checked radio button like this:

if err := f.DeleteFormControl("Sheet1", "A1"); err != nil {
    // ...
}
if err := f.AddFormControl("Sheet1", excelize.FormControl{
    Cell:    "A1",
    Type:    excelize.FormControlOptionButton,
    Text:    "Option Button",
    Checked: true,
}); err != nil {
    // ...
}

jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
- New exported function `DeleteFormControl` has been added
- Update unit tests
- Fix comments was missing after form control added
- Update pull request templates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants