daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Load and Sort Users DataTable
  2.         DataTable datatableUsers = UserMethods.GetUsers().Tables["Users"];
  3.         datatableUsers.DefaultView.Sort = "Name";
  4.  
  5.         // Filter Based on Search Box
  6.         datatableUsers.DefaultView.RowFilter = "Name LIKE '%" + user + "%' OR Username LIKE '%" + user + "%'"; ;  
  7.         DataView dataviewUsers = datatableUsers.DefaultView;
  8.  
  9.         // Loop Through Rows and Add UsersGrid to FlowLayoutPael
  10.         foreach (DataRowView datarowviewUsers in dataviewUsers)
  11.         {
  12.             var UsersGrid = new UsersGrid
  13.             {
  14.                 ID = (int)datarowviewUsers["ID"],
  15.                 Username = datarowviewUsers["Username"].ToString(),
  16.                 User = datarowviewUsers["Name"].ToString(),
  17.                 Admin = datarowviewUsers["Administrator"].ToString(),
  18.             };
  19.             flowlayoutpanelUsers.Controls.Add(UsersGrid);
  20.             UsersGrid.WasClicked += UsersGrid_WasClicked;
  21.         }
  22.    
  23. Admin = datarowviewUsers["Administrator"].ToString() == "True" ? true : false
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top