Jump to content
Xtreme .Net Talk

mocella

Avatar/Signature
  • Posts

    278
  • Joined

  • Last visited

Everything posted by mocella

  1. For a web-form you can do this: //GENERIC FUNCTION FOR SORTING A LIST BOX private void SortListBox(ListBox currList) { //COPY THE MEMBERS OF THE LISTBOX INTO AN ARRAY LIST ArrayList arraylist = new ArrayList(); foreach(ListItem li in currList.Items) { arraylist.Add(li); } arraylist.Sort(new ListObject(ListObject.Directions.ascending)); //SORT THE LIST - ASCENDING //REMOVE THE EXISTING ITEMS FROM LISTBOX currList.Items.Clear(); //RE-ADD THE SORTED ITEMS TO THE LISTBOX for(int i = 0 ; i < arraylist.Count ; i++) { currList.Items.Add((ListItem) arraylist[i]); } currList.SelectedIndex = -1; //ENSURE NO SELECTED ITEM } //*** NEED THIS FOR ARRAY-LIST SORTING: *** private class ListObject : IComparer { public enum Directions : int { ascending = 1, descending = (-1) }; private int direction = (int) ListObject.Directions.ascending; public ListObject() {} public ListObject(Directions direction) { this.direction = (int) direction; } public int Compare(object x, object y) { string xstring = ((ListItem) x).Text; string ystring = ((ListItem) y).Text; return xstring.CompareTo(ystring) * this.direction; } } //*******************************************[
  2. Or perhaps you're talking about zero-touch deployment? Check out this link if that's what you're asking about: http://msdn.microsoft.com/msdnmag/issues/02/07/NetSmartClients/
  3. You need to create yourself a setup project (under Setup and Deployment Projects). Easiest thing is to just add the setup project to your current solution and go from there. When you build the setup project, it will generate an MSI file for you.
×
×
  • Create New...