コード例 #1
0
    protected void grDirectory_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        GridView _gridView = (GridView)sender;
        // Get the selected index and the command name
        int    _selectedIndex = int.Parse(e.CommandArgument.ToString());
        string _commandName   = e.CommandName;

        _gridView.SelectedIndex = _selectedIndex;
        switch (_commandName)
        {
        case ("DoubleClick"):
            objMgr.DeleteDirectoryList(grDirectory.DataKeys[_gridView.SelectedIndex].Values[0].ToString());
            lblMsg.Text = "Directory deleted successfully";
            this.GetDirectory();
            TabContainer1.ActiveTabIndex = 2;
            break;
        }
    }