public void BindGrid()
    {
        // Declare col as Collection of Region_mst Object to get all records from table
        BLLCollection <Hub_mst> col = new BLLCollection <Hub_mst>();

        col = objhub.Get_All();
        Modegrdw.DataSource = col;
        Modegrdw.DataBind();
        ClearControl();
    }
    public void BindHub()
    {
        BLLCollection <Hub_mst> col = new BLLCollection <Hub_mst>();

        col = objHub.Get_All();
        drpHub.DataTextField  = "HubName";
        drpHub.DataValueField = "Hubid";
        drpHub.DataSource     = col;
        drpHub.DataBind();
        //ListItem item = new ListItem();
        //item.Text = "--------------Select--------------";
        //item.Value = "0";
        //drpHub.Items.Add(item);
        //drpHub.SelectedValue = "0";
    }
예제 #3
0
    public void BindHub()
    {
        BLLCollection <Hub_mst> col = new BLLCollection <Hub_mst>();

        col = objHub.Get_All();

        for (int i = 0; i < col.Count; i++)
        {
            for (int j = i; j < col.Count; j++)
            {
                if (String.Compare(col[i].Hubname, col[j].Hubname) > 0)
                {
                    Hub_mst obj = new Hub_mst();
                    obj    = col[i];
                    col[i] = col[j];
                    col[j] = obj;
                }
            }
        }
        drpHub.DataTextField  = "HubName";
        drpHub.DataValueField = "Hubid";
        drpHub.DataSource     = col;
        drpHub.DataBind();
////////////////////////////////////////////////////// //change done by meenakshi 12 july 2102
        ListItem item = new ListItem();

        //item.Text = "--------------Select--------------";
        item.Text  = "All";
        item.Value = "0";
        drpHub.Items.Add(item);
        drpHub.SelectedValue = "0";
        //item.Value = "0";
        //drpHub.Items.Add(item);
        //drpHub.SelectedValue = "0";


/////////////////////////////////////////////////////////////end
    }