Radio buttons issue

I’ve found very strange issue in radio buttons behaviour.

I have a template excel sheet with questions and answers (I attach excel
file). Answers are checked by radio buttons. Radio buttons are linked
with cells in ‘AnswerSheet’.

Now I have functionality to fill this template (select answers) using
aspose library, but this not work properly. Even by change value in
linked cell and also by checking radio button manually.



1.

If I change linked cells (in asnswerSheet) by below code:

worksheet.Cells[“C6”].PutValue(2);

worksheet.Cells[“C7”].PutValue(1);

Then:

- Radio button in group 1 is properly checked (but value in linked cell
is set to 0, but should be to 2)

- Radio button in group 2 is properly checked and also value in linked
cell is proper



2.

If I try to check manually by code:

(workbook.Worksheets[1].Shapes[0] as
Aspose.Cells.Drawing.RadioButton).IsChecked = true;

(workbook.Worksheets[1].Shapes[2] as
Aspose.Cells.Drawing.RadioButton).IsChecked = true;

Then:

- Radio button in group 1 is not checked, and value in linked cell is
not proper

- Radio button in group 2 is properly checked and also value in linked
cell is proper



3.

If I change linked cells (in asnswerSheet) and also check radio button
manually by below code:

worksheet.Cells[“C6”].PutValue(2);

worksheet.Cells[“C7”].PutValue(1);

(workbook.Worksheets[1].Shapes[0] as
Aspose.Cells.Drawing.RadioButton).IsChecked = true;

(workbook.Worksheets[1].Shapes[2] as
Aspose.Cells.Drawing.RadioButton).IsChecked = true;

Then:

It seems to work properly but with one strange issue.

If selected in radio button is option 1 then this value show in cell on
‘TTS’ sheet (it seems that this is put to answers sheet cell and ‘tts’
sheet). If selected option is not 1 this issue not present.



I spent many days and try many combinations, but without success.

Hi John,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after executing the following sample code using your file with the latest version: Aspose.Cells for .NET 8.2.0. Linked cell value of radio button is not correct.

We have logged this issue our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-42931.

I have attached the output xls file generated by the code and screenshot highlighting the issue for a reference.

C#


Workbook workbook = new Workbook(“issueTest.xls”);


Worksheet worksheet = workbook.Worksheets[“AnswerSheet”];


worksheet.Cells[“C6”].PutValue(2);

worksheet.Cells[“C7”].PutValue(3);


workbook.Save(“output.xls”);


Hi John,

Thanks for using Aspose.Cells.

Please call ShapeCollection.UpdateSelectedValue() to update the value of
shapes. Aspose.Cells does not automatically call this method for performance reason.

C#


Workbook workbook = new Workbook(@“D:\filetemp\issueTest.xls”);


Worksheet worksheet = workbook.Worksheets[“AnswerSheet”];


worksheet.Cells[“C6”].PutValue(2);


worksheet.Cells[“C7”].PutValue(3);


workbook.Worksheets[“TTS”].Shapes.UpdateSelectedValue();

workbook.Save(@“D:\filetemp\output.xls”);




Now works great!

Thank you :slight_smile:

Hi,


Good to know that if figures out your issue now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.