Wednesday, February 13, 2013

Remove item from array list of multiple column.


This problem occured when i was doing project in dotnetnuke 5.6.3 so in arraylist there have multiple columns and I and remove row which contains particular value of type.this is the code for solve this problem.

DotNetNuke.Entities.Users.UserController oUserController = new DotNetNuke.Entities.Users.UserController();
           
            ArrayList listroles = oUserController.GetUsers(this.PortalId, true, true);
            int j = 0;

            for (int i = 0; i < listroles.Count; i++)
            {
                DotNetNuke.Entities.Users.UserInfo info = (DotNetNuke.Entities.Users.UserInfo)listroles[i];
                if (info.Username == UserInfo.Username)
                {
                    listroles.Remove(info);
                }
            }

No comments:

Post a Comment