Sort by the first 3 characters
-
Complete class provided for entertainment purposes ;P
namespace BusinessEntities
{
public class DropDownLists
{
private Collection<ListItem> myList;public static DropDownLists Construct\_DropDownLists() { DropDownLists tmpDropDownLists \= new DropDownLists(); return tmpDropDownLists; } public Collection<ListItem\> MyList { get { if (myList \== null) { myList \= new Collection<ListItem\>(); } return myList; } set { myList \= value; } } /// <
-
Complete class provided for entertainment purposes ;P
namespace BusinessEntities
{
public class DropDownLists
{
private Collection<ListItem> myList;public static DropDownLists Construct\_DropDownLists() { DropDownLists tmpDropDownLists \= new DropDownLists(); return tmpDropDownLists; } public Collection<ListItem\> MyList { get { if (myList \== null) { myList \= new Collection<ListItem\>(); } return myList; } set { myList \= value; } } /// <
Congratulations to these "self-studies".
-+--+--+--+--+--+--+-+-+-+ Carlos Zani - SP - Brazil Powered by Microsof.Net
-
Complete class provided for entertainment purposes ;P
namespace BusinessEntities
{
public class DropDownLists
{
private Collection<ListItem> myList;public static DropDownLists Construct\_DropDownLists() { DropDownLists tmpDropDownLists \= new DropDownLists(); return tmpDropDownLists; } public Collection<ListItem\> MyList { get { if (myList \== null) { myList \= new Collection<ListItem\>(); } return myList; } set { myList \= value; } } /// <
But which part do you particularly wish to point out? I find the use of
string.ToString()
the most humorous. I'm also not sure what you mean by the title;Array.Sort(myKeys, myValues, 1, 3);
won't "Sort by the first 3 characters", it sorts the second through fourth items.modified on Sunday, June 8, 2008 11:14 AM
-
But which part do you particularly wish to point out? I find the use of
string.ToString()
the most humorous. I'm also not sure what you mean by the title;Array.Sort(myKeys, myValues, 1, 3);
won't "Sort by the first 3 characters", it sorts the second through fourth items.modified on Sunday, June 8, 2008 11:14 AM
PIEBALDconsult wrote:
I'm also not sure what you mean by the title; Array.Sort(myKeys, myValues, 1, 3); won't "Sort by the first 3 characters", it sorts the second through fourth items.
Exactly ;P Thats the real horror, how he gets there is a horror too! All this has been reduced to 2 lines of code getting data straight from the DB.
xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008) -
But which part do you particularly wish to point out? I find the use of
string.ToString()
the most humorous. I'm also not sure what you mean by the title;Array.Sort(myKeys, myValues, 1, 3);
won't "Sort by the first 3 characters", it sorts the second through fourth items.modified on Sunday, June 8, 2008 11:14 AM
:omg: I see now where it comes from! MSDN copy and paste code (and steal the comment while you at it)!! :sigh: http://msdn.microsoft.com/en-us/library/73z19xf7.aspx[^]
xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008) -
Complete class provided for entertainment purposes ;P
namespace BusinessEntities
{
public class DropDownLists
{
private Collection<ListItem> myList;public static DropDownLists Construct\_DropDownLists() { DropDownLists tmpDropDownLists \= new DropDownLists(); return tmpDropDownLists; } public Collection<ListItem\> MyList { get { if (myList \== null) { myList \= new Collection<ListItem\>(); } return myList; } set { myList \= value; } } /// <
leppie wrote:
/// /// This method can be customized to return a list of data from any source, e.g database, xml file, object, etc. /// /// Object instance of DropDownLists class. /// ItemCollection public Collection GetTitles(DropDownLists tmpDropDownLists) { //Currently the data is hardcoded, but can also be queried from a database. tmpDropDownLists.myList = new Collection(); ListItem li = new ListItem(); li.Value = "1"; li.Text = "Mr."; tmpDropDownLists.myList.Add(li); li = new ListItem(); li.Value = "2"; li.Text = "Mrs."; tmpDropDownLists.myList.Add(li); li = new ListItem(); li.Value = "3"; li.Text = "Me."; tmpDropDownLists.myList.Add(li); li = new ListItem(); li.Value = "4"; li.Text = "Dr."; tmpDropDownLists.myList.Add(li); li = new ListItem(); li.Value = "5"; li.Text = "Prof."; tmpDropDownLists.myList.Add(li);
Oh, if only there existed some technology where you could add items from some source of data. That would be sure to catch on. :rolleyes:
Deja View - the feeling that you've seen this post before.
-
leppie wrote:
/// /// This method can be customized to return a list of data from any source, e.g database, xml file, object, etc. /// /// Object instance of DropDownLists class. /// ItemCollection public Collection GetTitles(DropDownLists tmpDropDownLists) { //Currently the data is hardcoded, but can also be queried from a database. tmpDropDownLists.myList = new Collection(); ListItem li = new ListItem(); li.Value = "1"; li.Text = "Mr."; tmpDropDownLists.myList.Add(li); li = new ListItem(); li.Value = "2"; li.Text = "Mrs."; tmpDropDownLists.myList.Add(li); li = new ListItem(); li.Value = "3"; li.Text = "Me."; tmpDropDownLists.myList.Add(li); li = new ListItem(); li.Value = "4"; li.Text = "Dr."; tmpDropDownLists.myList.Add(li); li = new ListItem(); li.Value = "5"; li.Text = "Prof."; tmpDropDownLists.myList.Add(li);
Oh, if only there existed some technology where you could add items from some source of data. That would be sure to catch on. :rolleyes:
Deja View - the feeling that you've seen this post before.
Only if you publish documentation... perhaps on a website.
-
But which part do you particularly wish to point out? I find the use of
string.ToString()
the most humorous. I'm also not sure what you mean by the title;Array.Sort(myKeys, myValues, 1, 3);
won't "Sort by the first 3 characters", it sorts the second through fourth items.modified on Sunday, June 8, 2008 11:14 AM