How to store and retrieve the RadioGroup Radio Button and CheckBox of Ribbon Control from Winforms Devexpress to MS Access Database?

血红的双手。 提交于 2019-12-23 05:25:38

问题


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:


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 


来源:https://stackoverflow.com/questions/20593344/how-to-store-and-retrieve-the-radiogroup-radio-button-and-checkbox-of-ribbon-con

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!