Click here to Skip to main content
15,895,283 members
Home / Discussions / C#
   

C#

 
AnswerRe: What is wrong in this code? Pin
Guffa8-Sep-07 11:04
Guffa8-Sep-07 11:04 
GeneralRe: What is wrong in this code? [modified] Pin
andredani8-Sep-07 12:45
andredani8-Sep-07 12:45 
GeneralRe: What is wrong in this code? Pin
Insincere Dave8-Sep-07 14:16
Insincere Dave8-Sep-07 14:16 
GeneralRe: What is wrong in this code? Pin
andredani9-Sep-07 1:03
andredani9-Sep-07 1:03 
AnswerRe: What is wrong in this code? Pin
Guffa8-Sep-07 16:46
Guffa8-Sep-07 16:46 
GeneralRe: What is wrong in this code? Pin
andredani9-Sep-07 1:07
andredani9-Sep-07 1:07 
AnswerRe: What is wrong in this code? Pin
Guffa9-Sep-07 8:43
Guffa9-Sep-07 8:43 
AnswerRe: What is wrong in this code? Pin
Skippums10-Sep-07 4:16
Skippums10-Sep-07 4:16 
IList<string> m_SubItems = new List<string>();
if (m_ListView.SelectedItems.Count > 0) {
// Why do you need SelectedItems.Count > 0? ...
// You don't ever reference them again within the if statement
for (int i = m_ListView.Items.Count - 1; i >= 0; --i) {
ListViewItem current = m_ListView.Items[i];
string item = current.SubItems[1].Text;
if (m_SubItems.Contains(item)) {
// This code assumes that all integers have only one digit.
// If you want something different, you must change how index is created.
int index = (int)item[item.Length - 1];
item = item.Substring(0, item.Length - 1);
do {
ListViewItem newItem = new ListViewItem();
...
newItem.SubItems.Add(new ListViewSubitem(item + (++index).ToString()));
m_ListView.Items.Add(newItem);
} while (m_SubItems.Contains(item + index.ToString()));
} else {
m_SubItems.Add(item);
}
}
}

Hope this helps!

Jeff
GeneralRe: What is wrong in this code? Pin
andredani10-Sep-07 4:33
andredani10-Sep-07 4:33 
GeneralRe: What is wrong in this code? Pin
Skippums10-Sep-07 4:43
Skippums10-Sep-07 4:43 
GeneralRe: What is wrong in this code? Pin
andredani10-Sep-07 12:21
andredani10-Sep-07 12:21 
GeneralRe: What is wrong in this code? Pin
Skippums10-Sep-07 12:23
Skippums10-Sep-07 12:23 
GeneralRe: What is wrong in this code? Pin
andredani10-Sep-07 12:27
andredani10-Sep-07 12:27 
GeneralRe: What is wrong in this code? Pin
Skippums10-Sep-07 13:17
Skippums10-Sep-07 13:17 
QuestionHelp regarding datagridview control Pin
anu817-Sep-07 19:57
anu817-Sep-07 19:57 
QuestionApplication + Remoting +Terminal Server Issue. Help Pin
fearless stallion7-Sep-07 18:27
fearless stallion7-Sep-07 18:27 
AnswerRe: Application + Remoting +Terminal Server Issue. Help Pin
Dave Kreskowiak8-Sep-07 3:18
mveDave Kreskowiak8-Sep-07 3:18 
GeneralRe: Application + Remoting +Terminal Server Issue. Help Pin
fearless stallion8-Sep-07 18:05
fearless stallion8-Sep-07 18:05 
Questiontextbox & tab page bugg? Pin
rbuchana7-Sep-07 18:01
rbuchana7-Sep-07 18:01 
AnswerRe: textbox & tab page bugg? Pin
rohitsrivastava7-Sep-07 19:42
rohitsrivastava7-Sep-07 19:42 
GeneralRe: textbox & tab page bugg? Pin
rbuchana8-Sep-07 4:39
rbuchana8-Sep-07 4:39 
Questioncollection editors &amp; component/control designers [modified] Pin
urbane.tiger7-Sep-07 17:31
urbane.tiger7-Sep-07 17:31 
QuestionHttpWebRequest performance and keep-alive Pin
pattyweb7-Sep-07 13:47
pattyweb7-Sep-07 13:47 
AnswerRe: HttpWebRequest performance and keep-alive Pin
Scott Dorman7-Sep-07 13:54
professionalScott Dorman7-Sep-07 13:54 
QuestionNeed help with panels and forms? Pin
DogMa3x7-Sep-07 12:28
DogMa3x7-Sep-07 12:28 

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.