Esempio n. 1
0
 private void BindGrid(string listName, string parentKey)
 {
     try
     {
         ListManagementController objController = new ListManagementController();
         DataSet ds = objController.GetListInfoInDataSet(listName, parentKey, -1, GetCurrentCultureName);
         if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
         {
             DataTable dtList = ds.Tables[0];
             gdvSubList.DataSource = dtList;
             gdvSubList.DataBind();
             ViewState["LISTTABLE"] = dtList;
             ViewState["LIST"]      = dtList.Rows.Count;
             if (gdvSubList.Rows.Count > 0)
             {
                 lblEntry.Text = dtList.Rows.Count + " " + GetSageMessage("ListSettings", "Entries");
                 if (gdvSubList.PageIndex == 0)
                 {
                     gdvSubList.Rows[0].FindControl("imgListUp").Visible = false;
                 }
                 if (gdvSubList.PageIndex == (gdvSubList.PageCount - 1))
                 {
                     gdvSubList.Rows[gdvSubList.Rows.Count - 1].FindControl("imgListDown").Visible = false;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }