How to store and retrieve the RadioGroup Radio But

2019-06-10 00:31发布

In my form I used Ribbon control in that RadioGroup is used for calculations. Now I need to store content of form and want to retrieve it back if I click in Gridview. I can able to store and retrieve textedit, lookup edit and checkedit outside Ribbon Control. How to store and retrieve the RadioGroup from Ribbon Control ??

example for storing CheckBox I used this code

 bool temp = barCheckItem1.Checked;

In Access Database used "Yes/No" Data Type to store. For retrieve used this code

 barCheckItem1.Checked = reader.GetBoolean(2);

this code work fine for CheckBox but I need to Store RadioButton RadioGroup. How to Store & Retrieve it ?? Help me. Thanks in Advance.

1条回答
小情绪 Triste *
2楼-- · 2019-06-10 01:19

Just store barEditItem.EditValue which is the selected item in the RadioButton.

I assume you have int as EditValue from your previous question. So this should be enough.

int selectedItem = (int)barEditItem.EditValue;//To Store

Store the selected item in DB

barEditItem.EditValue = reader.GetInt32(index);//To retrieve back 
查看更多
登录 后发表回答