private ToDoListNavigatorTDS SubmitSearch()
        {
            // Retrieve clauses
            string whereClause = GetWhereClause();
            string orderByClause = GetOrderByClause();
            string conditionValue = "";
            string conditionName = "";

            ToDoListNavigator toDolistNavigator = new ToDoListNavigator();
            string fmType = hdfFmType.Value.Trim();
            int companyId = Int32.Parse(hdfCompanyId.Value.Trim());

            // ... Load data
            FmTypeViewConditionGateway fmTypeViewConditionGateway = new FmTypeViewConditionGateway();
            fmTypeViewConditionGateway.LoadByFmTypeConditionId(fmType, companyId, int.Parse(ddlCondition1.SelectedValue));

            conditionValue = fmTypeViewConditionGateway.GetColumn_(fmType, companyId, int.Parse(ddlCondition1.SelectedValue));
            conditionName = fmTypeViewConditionGateway.GetName(fmType, companyId, int.Parse(ddlCondition1.SelectedValue));

            toDolistNavigator.Load(whereClause, orderByClause, conditionValue, conditionName, tbxCondition1.Text.Trim(), companyId, fmType);

            return (ToDoListNavigatorTDS)toDolistNavigator.Data;
        }
        private void PostPageChanges()
        {
            ToDoListNavigator toDoListNavigator = new ToDoListNavigator(toDoListNavigatorTDS);

            // Update toDoListNavigator rows
            foreach (GridViewRow row in grdToDoListNavigator.Rows)
            {
                string toDoIdLabel = ((Label)row.FindControl("lblToDoId")).Text.Trim();
                int toDoId = Int32.Parse(toDoIdLabel.ToString().Trim());
                bool selected = ((CheckBox)row.FindControl("cbxSelected")).Checked;

                toDoListNavigator.Update(toDoId, selected);
            }

            toDoListNavigator.Data.AcceptChanges();

            // Store datasets
            Session["toDoListNavigatorTDS"] = toDoListNavigatorTDS;
        }