protected void uiGridViewCategories_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditCategory") { VedioCategories objData = new VedioCategories(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxEnName.Text = objData.EnName; uiTextBoxArName.Text = objData.ArName; uiTextBoxEnDesc.Text = objData.EnDescription; uiTextBoxArDesc.Text = objData.ArDescription; uiPanelViewCategories.Visible = false; uiPanelEdit.Visible = true; CurrentCategory = objData; } else if (e.CommandName == "DeleteCategory") { VedioCategories objData = new VedioCategories(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); CurrentCategory = null; BindData(); } }
protected void uiGridViewSubCategories_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView row = (DataRowView)e.Row.DataItem; VedioCategories objData = new VedioCategories(); objData.LoadByPrimaryKey(Convert.ToInt32(row["CategoryID"].ToString())); Label l = (Label)e.Row.FindControl("uiLabelCategoryName"); l.Text = objData.ArName; } }