private void OtherOpportunityDataBind()
        {
            Opportunity opp = new Opportunity();

            ddlOtherOpportunity.DataSource     = opp.GetAllOpportunities();
            ddlOtherOpportunity.DataTextField  = "Name";
            ddlOtherOpportunity.DataValueField = "OpportunityID";
            ddlOtherOpportunity.DataBind();
        }
Example #2
0
        private void DataBind()
        {
            Opportunity        opp     = new Opportunity();
            List <Opportunity> oppList = opp.GetAllOpportunities();

            if (oppList.Count == 0)
            {
                Opportunity oppS = new Opportunity();
                oppList.Add(oppS);
                gvOpportunity.DataSource = oppList;
                gvOpportunity.DataBind();
                gvOpportunity.Rows[0].Visible = false;
            }
            else
            {
                gvOpportunity.DataSource = oppList;
                gvOpportunity.DataBind();
            }
        }