protected void grvPermissoes_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { GridView grvPermissoes = (GridView)sender; int sis_id = Convert.ToInt32(grvPermissoes.DataKeys[e.Row.RowIndex]["sis_id"]); int mod_id = Convert.ToInt32(grvPermissoes.DataKeys[e.Row.RowIndex]["mod_id"]); DataTable dtModulo = SYS_ModuloBO.SelectBy_mod_id_Filhos(sis_id, mod_id); if (dtModulo.Rows.Count > 0) { GridView grv = (GridView)e.Row.FindControl("grvPermissoesChild"); grv.DataSource = SYS_GrupoBO.GetSelectPermissoes(mod_id, new Guid(grvPermissoes.DataKeys[e.Row.RowIndex]["gru_id"].ToString())); grv.DataBind(); LinkButton lkb = (LinkButton)e.Row.FindControl("lkbExpandir"); if (lkb != null) { lkb.OnClientClick = "ExpandCollapse3('" + grv.ClientID + "', '" + lkb.ClientID + "'); return false;"; lkb.Visible = true; } } else { e.Row.Cells[ColumnCollapse].Visible = false; } } }
protected void Page_PreRender(object sender, EventArgs e) { grvPermissoes.DataSource = SYS_GrupoBO.GetSelectPermissoes(ModuloPaiId, GrupoId); grvPermissoes.DataBind(); }