/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDeleteChannel_Click(object sender, EventArgs e) { TreeNode tn = this.TreeView1.SelectedNode; if (IsChannelTreeNode(tn)) { int id = GetSelectedID(tn); ChannelDBI.DeleteChannel(id); BindTree(); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { Trace.Warn("GridView1.DataKeys.Count = " + this.GridView1.DataKeys.Count); Trace.Warn("GridView1_RowDeleting RowIndex = " + e.RowIndex); // TODO: // int index = e.RowIndex; object value = this.GridView1.DataKeys[index].Value; int id = Convert.ToInt32(value); ChannelDBI.DeleteChannel(id); Fill(); }