private void RowsDataGrid_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            TextBox updatedChildText = ((TextBox)e.Item.Cells[0].Controls[0]);

            if (updatedChildText.Text.Length == 0)
            {
                MessageLabel.Visible = true;
                ((PageBase)Page).ShowErrorMessage(MessageLabel, ((PageBase)Page).GetPageResource("RowMissingQuestionMessage"));
            }
            else
            {
                MatrixChildQuestionData childQuestion = new MatrixChildQuestionData();
                MatrixChildQuestionData.ChildQuestionsRow updatedChildQuestion =
                    childQuestion.ChildQuestions.NewChildQuestionsRow();
                updatedChildQuestion.QuestionId =
                    int.Parse(RowsDataGrid.DataKeys[e.Item.ItemIndex].ToString());
                updatedChildQuestion.QuestionText = updatedChildText.Text;
                childQuestion.ChildQuestions.AddChildQuestionsRow(updatedChildQuestion);
                new Question().UpdateChildQuestion(childQuestion, ChildsLanguageDropdownlist.SelectedValue);
                RowsDataGrid.EditItemIndex = -1;
                BindChildQuestions();
                MessageLabel.Visible = true;
                ((PageBase)Page).ShowNormalMessage(MessageLabel, ((PageBase)Page).GetPageResource("MatrixRowUpdatedMessage"));
            }
        }
        private void AddRowButton_Click(object sender, System.EventArgs e)
        {
            if (NewRowTextBox.Text.Length == 0)
            {
                MessageLabel.Visible = true;
                ((PageBase)Page).ShowErrorMessage(MessageLabel, ((PageBase)Page).GetPageResource("RowMissingQuestiondMessage"));
            }
            else
            {
                MatrixChildQuestionData childQuestion = new MatrixChildQuestionData();
                MatrixChildQuestionData.ChildQuestionsRow updatedChildQuestion =
                    childQuestion.ChildQuestions.NewChildQuestionsRow();
                updatedChildQuestion.ParentQuestionId = _parentQuestionId;
                updatedChildQuestion.QuestionText     = NewRowTextBox.Text;
                childQuestion.ChildQuestions.AddChildQuestionsRow(updatedChildQuestion);
                new Question().AddChildQuestion(childQuestion);

                BindChildQuestions();
                MessageLabel.Visible = true;
                ((PageBase)Page).ShowNormalMessage(MessageLabel, ((PageBase)Page).GetPageResource("MatrixRowAddedMessage"));

                NewRowTextBox.Text = string.Empty;
            }
        }