HBM.Roles.LoadRights C# (CSharp) Method

LoadRights() protected method

protected LoadRights ( ) : void
return void
        protected void LoadRights()
        {
            try
            {
                UserMan.Rights RightsObj = new UserMan.Rights();

                if (this.hdnRoleId.Value != string.Empty)
                {
                    RightsObj.RolesId = Convert.ToInt32(this.hdnRoleId.Value);
                }

                gvRights.DataSource = RightsObj.SelectByRolesId();
                gvRights.DataBind();

                if (this.hdnRoleId.Value != string.Empty)
                {

                    for (int i = 0; i <= gvRights.VisibleRowCount - 1; i++)
                    {
                        if (gvRights.GetRowValues(i,"RolesId").ToString() != string.Empty)
                        {
                            gvRights.Selection.SelectRow(i);
                        }
                    }

                }

            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }