示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Title = table.DisplayName;

        // Disable various options if the table is readonly
        if (table.IsReadOnly || UtilsConfig.isViewTable(table.DisplayName))
        {
            GridView1.Columns[0].Visible       = false;
            InsertHyperLink.Visible            = false;
            GridView1.EnablePersistedSelection = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Title = table.DisplayName;

        // Selection from url
        if (!Page.IsPostBack && table.HasPrimaryKey)
        {
            GridView1.SelectedPersistedDataKey = table.GetDataKeyFromRoute();
            if (GridView1.SelectedPersistedDataKey == null)
            {
                GridView1.SelectedIndex = 0;
            }
        }

        // Disable various options if the table is readonly
        if (table.IsReadOnly || UtilsConfig.isViewTable(table.DisplayName))
        {
            DetailsPanel.Visible = false;
            GridView1.AutoGenerateSelectButton = false;
            GridView1.AutoGenerateEditButton   = false;
            GridView1.AutoGenerateDeleteButton = false;
            GridView1.EnablePersistedSelection = false;
        }
    }