/ Published in: C#

Pretty intuitive, might be an easier/simpler way.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//This was the hard way. public static Lookup.StatusDataTable GetStatuses(bool intranetMode) { //TODO: Handle Intranet vs Internet mode. Lookup.StatusDataTable sdt = sta.GetStatusData(); DataRow[] rows = sdt.Select("Status <> 'Unapproved' and Status <> 'Closed'"); foreach(DataRow dr in rows) { retVal.Rows.Add(dr.ItemArray); } return retVal; } //Here's the easy way: public static Lookup.StatusDataTable GetStatuses(bool intranetMode) { Lookup.StatusDataTable sdt = sta.GetStatusData(); if (!intranetMode) { sdt.DefaultView.RowFilter = "Status <> 'Unapproved' and Status <> 'Closed'"; } return sdt; }
Comments
