Click here to Skip to main content
15,886,110 members
Home / Discussions / C#
   

C#

 
QuestionThumbnailPhoto + DataTable + GridView Pin
Member 110296479-Sep-14 2:05
Member 110296479-Sep-14 2:05 
QuestionRe: ThumbnailPhoto + DataTable + GridView Pin
ZurdoDev9-Sep-14 2:22
professionalZurdoDev9-Sep-14 2:22 
AnswerRe: ThumbnailPhoto + DataTable + GridView Pin
Member 110296479-Sep-14 2:30
Member 110296479-Sep-14 2:30 
QuestionSend http request with Windows Mobile through VPN installed on PC Pin
Wakonda8-Sep-14 2:58
Wakonda8-Sep-14 2:58 
AnswerRe: Send http request with Windows Mobile through VPN installed on PC Pin
Eddy Vluggen8-Sep-14 8:08
professionalEddy Vluggen8-Sep-14 8:08 
AnswerRe: Send http request with Windows Mobile through VPN installed on PC Pin
Zain Ul Abidin8-Sep-14 21:05
Zain Ul Abidin8-Sep-14 21:05 
AnswerRe: Send http request with Windows Mobile through VPN installed on PC Pin
Bernhard Hiller8-Sep-14 21:34
Bernhard Hiller8-Sep-14 21:34 
QuestionSorting a generic list ? Pin
Member 105035147-Sep-14 23:51
Member 105035147-Sep-14 23:51 
I am trying to move items up and down in generic list but not getting desired results If I have 5 items and and one their be 6 with order id's of 1 to 6 then when i move an item up one position via button click say item 6 it would become 5 and what was at 5 would become 6.

Can Someone help me out here please on the logic below?

C#
ObservableCollection<CustomColumnsModel> columnsList = this.WizardData.ConcreteCustomColumnsProxy;
     Extensions.MoveItemUp(columnsList, this.listView1.SelectedIndex);
     List<CustomColumnsModel> forUpdate = new List<CustomColumnsModel>();





 int offset = 0;
 foreach (CustomColumnsModel item in this.listView1.Items)
 {
     if (this.listView1.SelectedItems.Contains(item))
     {
         offset++;
         item.CustomColumnsOrder--;

     }else
     item.CustomColumnsOrder += offset;

 }

SuggestionMessage Closed Pin
8-Sep-14 20:19
professionalGeorge Jonsson8-Sep-14 20:19 
GeneralRe: Sorting a generic list ? Pin
Richard MacCutchan8-Sep-14 20:36
mveRichard MacCutchan8-Sep-14 20:36 
GeneralRe: Sorting a generic list ? Pin
George Jonsson8-Sep-14 21:01
professionalGeorge Jonsson8-Sep-14 21:01 
GeneralRe: Sorting a generic list ? Pin
Richard MacCutchan8-Sep-14 21:22
mveRichard MacCutchan8-Sep-14 21:22 
SuggestionRe: Sorting a generic list ? Pin
Richard MacCutchan8-Sep-14 20:42
mveRichard MacCutchan8-Sep-14 20:42 
QuestionStumped - How do I code this loop... Pin
Andy_L_J6-Sep-14 18:00
Andy_L_J6-Sep-14 18:00 
AnswerRe: Stumped - How do I code this loop... Pin
Garth J Lancaster6-Sep-14 19:08
professionalGarth J Lancaster6-Sep-14 19:08 
AnswerRe: Stumped - How do I code this loop... Pin
CPallini6-Sep-14 19:25
mveCPallini6-Sep-14 19:25 
GeneralRe: Stumped - How do I code this loop... Pin
Andy_L_J6-Sep-14 20:04
Andy_L_J6-Sep-14 20:04 
GeneralRe: Stumped - How do I code this loop... Pin
CPallini6-Sep-14 20:22
mveCPallini6-Sep-14 20:22 
AnswerRe: Stumped - How do I code this loop... Pin
Andy_L_J13-Sep-14 11:02
Andy_L_J13-Sep-14 11:02 
GeneralRe: Stumped - How do I code this loop... Pin
CPallini13-Sep-14 12:37
mveCPallini13-Sep-14 12:37 
GeneralRe: Stumped - How do I code this loop... Pin
BillWoodruff7-Sep-14 23:30
professionalBillWoodruff7-Sep-14 23:30 
GeneralRe: Stumped - How do I code this loop... Pin
CPallini8-Sep-14 0:32
mveCPallini8-Sep-14 0:32 
GeneralRe: Stumped - How do I code this loop... Pin
BillWoodruff8-Sep-14 23:40
professionalBillWoodruff8-Sep-14 23:40 
GeneralRe: Stumped - How do I code this loop... Pin
Pete O'Hanlon8-Sep-14 23:54
mvePete O'Hanlon8-Sep-14 23:54 
GeneralRe: Stumped - How do I code this loop... Pin
CPallini9-Sep-14 2:55
mveCPallini9-Sep-14 2:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.