Hi Guy,
Yes, my code is using TryGetValue and my last reply was just aiming to provide additional information about what the TryGetValue does. In short, this property allows you to retrieve a TextBox instance that you can use further to set its Text.
As to my comment, it aims to clarify that my code snippet:
uses new TextBox instances for demonstration purposes. However, I suppose that you already have your TextBoxes added to your form, so you just need to add their instances to the Dictionary, instead of using "new TextBox()" instances. Let's say that you define your TextBox instances programmatically, here is how you can add them to your Dictionary:
private void Form1_Load(object sender, EventArgs e)
{
TextBox textBox = new TextBox();
this.Controls.Add(textBox);
textBox.Size = new Size(100, 20);
textBox.Location = new Point(10, 10);
sumTextBoxes.Add("A", textBox);
textBox = new TextBox();
this.Controls.Add(textBox);
textBox.Size = new Size(100, 20);
textBox.Location = new Point(10, 40);
sumTextBoxes.Add("B", textBox);
textBox = new TextBox();
this.Controls.Add(textBox);
textBox.Size = new Size(100, 20);
textBox.Location = new Point(10,70);
sumTextBoxes.Add("C", textBox);
textBox = new TextBox();
this.Controls.Add(textBox);
textBox.Size = new Size(100, 20);
textBox.Location = new Point(10, 100);
sumTextBoxes.Add("D", textBox);
DataTable table = new DataTable();
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Group", typeof(string));
table.Columns.Add("RevenueValue", typeof(decimal));
table.Rows.Add("Product1", "A", 100.11);
table.Rows.Add("Product2", "A", 200.22);
table.Rows.Add("Product3", "B", 300.33);
table.Rows.Add("Product4", "B", 400.44);
table.Rows.Add("Product5", "B", 500.55);
table.Rows.Add("Product6", "C", 600.66);
table.Rows.Add("Product7", "C", 700.77);
table.Rows.Add("Product8", "D", 800.88);
table.Rows.Add("Product9", "D", 900.99);
table.Rows.Add("Product10", "D", 1000.00);
radGridView1.DataSource = table;
radGridView1.GroupSummaryEvaluate += new Telerik.WinControls.UI.GroupSummaryEvaluateEventHandler(radGridView1_GroupSummaryEvaluate);
radGridView1.GroupDescriptors.Add("Group", System.ComponentModel.ListSortDirection.Ascending);
}
If you continue to experience an issue with this solution, please describe it in details, so that we can assist you further.
Thank you for your time and cooperation.
Greetings,
Julian Benkov
the Telerik team