0

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.

Srihari
  • 2,387
  • 9
  • 51
  • 82

1 Answers1

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 
Sriram Sakthivel
  • 72,067
  • 7
  • 111
  • 189
  • Hi Sriram. Ya storing as integer and retrieving it, checks the exact Radio Button but in the grid I hide some columns while clicking that radio button this task didn't perform while retrieving. I get normal grid with all columns enables. any idea to solve this ? – Srihari Dec 16 '13 at 12:12
  • So you mean some events not firing? – Sriram Sakthivel Dec 16 '13 at 12:18
  • ya. In normal form i used this radio button to hide 2 columns & Perform other calculation in the gridview. While retrieving this things not fired. – Srihari Dec 16 '13 at 12:27
  • May be that is the expected behavior, check in documentation. IIRC some of events won't fire when you do it manually in devexpress (ex: cellValueChanged won't fire in GridControl and so on), vendor will have a workaround for this. – Sriram Sakthivel Dec 16 '13 at 12:29
  • May be But normal checkedit in the form is working exactly. I have normal checkedit in form and if checkedit is Checked perform one type oof calculation & when not checked perform other type of calculation. While retrieving I get exact output. – Srihari Dec 16 '13 at 12:44
  • Hi Sriram, Thanks a lot I solved that Simple recall function according to Editvalue. `if(barEditItem1.EditValue==1){ discount1(); } else { dicount2(); }`. – Srihari Dec 16 '13 at 13:17