Exemplo n.º 1
0
 void bindCommunity()
 {
     votObj.comId                = "%";
     ddlCommunity.DataSource     = votObj.getCommunityMaster();
     ddlCommunity.DataTextField  = "communityName";
     ddlCommunity.DataValueField = "communityId";
     ddlCommunity.DataBind();
     ddlCommunity.Items.Insert(0, new ListItem("Select Community", "0"));
 }
    void LoadCommunity()
    {
        votObj.comId = "%";
        DataTable dttemp = votObj.getCommunityMaster();

        ddlCommunity.DataSource     = dttemp;
        ddlCommunity.DataTextField  = "communityName";
        ddlCommunity.DataValueField = "communityId";
        ddlCommunity.DataBind();
        ddlCommunity.Items.Insert(0, new ListItem("All Communitys", string.Join(",", dttemp.AsEnumerable().Select(x => x.Field <int>("communityId").ToString()).ToArray())));
    }