Probably not in any meaningful way: you'd have to write some code to give you properties that you can work with. Something like this works, but it might not behave the way you want (try it and see). Note that it's making some pretty big assumptions (you have only RadioButtons in the groupbox and that at least one is checked).
private void Form1_Load(object sender, System.EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("abc"); for (int i=0; i<10; i++) dt.Rows.Add(new object[] {"val" + i}); dataGrid1.DataSource = dt; this.DataBindings.Add("CheckedText", dt, "abc"); }
public string CheckedText { get { return CheckedRadioButton.Text; } set { CheckedRadioButton.Text = value; } }
public RadioButton CheckedRadioButton { get { foreach (RadioButton rb in groupBox1.Controls) { if (rb.Checked) return rb; } return null; } }
|