RobotStudio event

write rapid data



At the click of a button, i would like to write the index of a combobox in a variable "NoProd" in the controller ?????????
 
Here is the code but it<s not finish....
 
 
private
void btnProduction_click(object sender, EventArgs e)
{
int selectedIndex = cbxChoix.SelectedIndex;
Object selectedItem = cbxChoix.SelectedItem;
MessageBox.Show("Selected Item Text: " + selectedItem.ToString() + "
"
+
"Index: " + selectedIndex.ToString());
RapidData rd = aController.Rapid.GetRapidData("T_ROB1", "MainModule", "NoProd");
?????   like    rd.value = selectedIndex;      but it doesn't work.

}