Hi,
My requirement is Bind the grid dynamic , and add the controls like Text Box And rad Como box at run time by Item value.
so far have done the control adding and now my grid is ready to take values from user ,
but when user selected value from rad combo box (dynamic added control in grid), and click the save button i cannot find the Rad Combo box
pls suggest me the way how to get the values for dynamically added controls in Rad-grid on button click.
below are the steps i followed
1. Added Grid in Aspx. with Autogenerated Column = true
2. On Item created event added dynamic controls in Grid.
3. bind the data to ad combo box (dynamic added control in grid)
4. on save Button i have to save the selected values from rad combo box (dynamic added control in grid), to data base
in above step 1 to 3 are done , but step 4 making me trouble .
below is code for button click.
protected void btnSaveAll_Click(object sender, EventArgs e)
{
Questionnaire MyQue = Questionnaire.getQuestionnaire(mQuestionnaireid);
ArrayList ColumnLst = GetColumnList();
Dictionary<string,string> RowSplitValue = new Dictionary<string,string>();
foreach (GridEditableItem Item in rgPivotQuestionnaireResult.MasterTableView.Items)
{
foreach (GridColumn Column in rgPivotQuestionnaireResult.MasterTableView.RenderColumns)
{
if (ColumnLst.Contains(Column.UniqueName))
{
//RowSplitValue = new Dictionary<string, string>(Item.SavedOldValues[Column.UniqueName]);
if (Item[Column].Controls.Count > 0)
{
Control ItemControle= new Control();
ItemControle = Item[Column].Controls[0];
if (ItemControle is TextBox)
{
TextBox TxtBx = (TextBox)Item[Column].Controls[0];
}
if (Item[Column].Controls.Count > 1)
{
ItemControle = Item[Column].Controls[1];
if (ItemControle is RadComboBox)
{
RadComboBox RCB = (RadComboBox)Item[Column].Controls[1];
MyQue .Answervalue = RCB.SelectedValue;
}
}
}
}
}
}
MyQue .Save();
}
My requirement is Bind the grid dynamic , and add the controls like Text Box And rad Como box at run time by Item value.
so far have done the control adding and now my grid is ready to take values from user ,
but when user selected value from rad combo box (dynamic added control in grid), and click the save button i cannot find the Rad Combo box
pls suggest me the way how to get the values for dynamically added controls in Rad-grid on button click.
below are the steps i followed
1. Added Grid in Aspx. with Autogenerated Column = true
2. On Item created event added dynamic controls in Grid.
3. bind the data to ad combo box (dynamic added control in grid)
4. on save Button i have to save the selected values from rad combo box (dynamic added control in grid), to data base
in above step 1 to 3 are done , but step 4 making me trouble .
below is code for button click.
protected void btnSaveAll_Click(object sender, EventArgs e)
{
Questionnaire MyQue = Questionnaire.getQuestionnaire(mQuestionnaireid);
ArrayList ColumnLst = GetColumnList();
Dictionary<string,string> RowSplitValue = new Dictionary<string,string>();
foreach (GridEditableItem Item in rgPivotQuestionnaireResult.MasterTableView.Items)
{
foreach (GridColumn Column in rgPivotQuestionnaireResult.MasterTableView.RenderColumns)
{
if (ColumnLst.Contains(Column.UniqueName))
{
//RowSplitValue = new Dictionary<string, string>(Item.SavedOldValues[Column.UniqueName]);
if (Item[Column].Controls.Count > 0)
{
Control ItemControle= new Control();
ItemControle = Item[Column].Controls[0];
if (ItemControle is TextBox)
{
TextBox TxtBx = (TextBox)Item[Column].Controls[0];
}
if (Item[Column].Controls.Count > 1)
{
ItemControle = Item[Column].Controls[1];
if (ItemControle is RadComboBox)
{
RadComboBox RCB = (RadComboBox)Item[Column].Controls[1];
MyQue .Answervalue = RCB.SelectedValue;
}
}
}
}
}
}
MyQue .Save();
}