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

C#

 
GeneralRe: C# Topmost without focus Pin
led mike29-Jul-08 10:34
led mike29-Jul-08 10:34 
GeneralRe: C# Topmost without focus Pin
Zocrates29-Jul-08 10:42
Zocrates29-Jul-08 10:42 
GeneralRe: C# Topmost without focus Pin
Zocrates29-Jul-08 10:51
Zocrates29-Jul-08 10:51 
GeneralRe: C# Topmost without focus Pin
Zocrates29-Jul-08 10:57
Zocrates29-Jul-08 10:57 
GeneralRe: C# Topmost without focus Pin
Zocrates29-Jul-08 11:41
Zocrates29-Jul-08 11:41 
QuestionPanel Refresh problem Pin
jchigg200029-Jul-08 5:06
jchigg200029-Jul-08 5:06 
AnswerRe: Panel Refresh problem Pin
DaveyM6929-Jul-08 6:16
professionalDaveyM6929-Jul-08 6:16 
Questionmaking dynamic ListViewGroups Pin
Yosh_29-Jul-08 4:47
professionalYosh_29-Jul-08 4:47 
Hi Guys,
i'm trying to sort the result from a datatable based on month and year.
getMonth below arranges d group header how i want. But the code puts on item per group. The prob, groups are repeating. Ex: May, 2008 repeats like five times but with diff items under it.

private string getMonth(string theDate)<br />
{<br />
   //rip this date(7/12/2008) and produce something like July 2008. GO!<br />
   string theMonth = theDate.Substring(0, theDate.IndexOf("/"));<br />
   string theYear = theDate.Substring(theDate.LastIndexOf("/") + 1, 4);<br />
<br />
   return (MonthName)int.Parse(theMonth) + ", " + theYear;<br />
}


Then i try to add the items, first into an array, then a ListViewItem
<br />
            for (i = 0; i < dtAcct.Rows.Count; i++)<br />
            {<br />
                DataRow drow = dtAcct.Rows[i];<br />
<br />
                ListViewGroup lvg = new ListViewGroup(getMonth(drow[0].ToString()));<br />
                //wanna add d group to the LV<br />
                    lvAccount.Groups.Add(lvg);<br />
<br />
                string[] items = { Warehouse.DateMender(DateTime.Parse(drow[0].ToString())),<br />
                    drow[1].ToString(), //debit<br />
                    drow[2].ToString(), //credit<br />
                    //details<br />
                    setTransDetails(Int32.Parse(drow[3].ToString()), drow[4].ToString()) };<br />
<br />
                ListViewItem lvi = new ListViewItem(items, lvg);<br />
                // Add the list items to the ListView<br />
                lvAccount.Items.Add(lvi);<br />
            }<br />


pls, can anyone help resolve this for me. Thanx a million!

Big Grin | :-D Wink | ;)

He who goes for revenge must first dig two graves.

AnswerRe: making dynamic ListViewGroups Pin
nelsonpaixao29-Jul-08 12:47
nelsonpaixao29-Jul-08 12:47 
QuestionPublishing a console application? Pin
Goalie3529-Jul-08 4:14
Goalie3529-Jul-08 4:14 
AnswerRe: Publishing a console application? Pin
leppie29-Jul-08 4:48
leppie29-Jul-08 4:48 
AnswerRe: Publishing a console application? Pin
Mircea Puiu29-Jul-08 4:58
Mircea Puiu29-Jul-08 4:58 
QuestionMultiThread Programing Pin
LincolnGuimaraes29-Jul-08 3:58
LincolnGuimaraes29-Jul-08 3:58 
AnswerRe: MultiThread Programing Pin
Mircea Puiu29-Jul-08 4:47
Mircea Puiu29-Jul-08 4:47 
AnswerRe: MultiThread Programing Pin
Yosh_29-Jul-08 5:00
professionalYosh_29-Jul-08 5:00 
AnswerRe: MultiThread Programing Pin
Yosh_29-Jul-08 5:01
professionalYosh_29-Jul-08 5:01 
AnswerRe: MultiThread Programing Pin
Guffa29-Jul-08 6:34
Guffa29-Jul-08 6:34 
AnswerRe: MultiThread Programing Pin
Joe Woodbury29-Jul-08 9:24
professionalJoe Woodbury29-Jul-08 9:24 
Questionjavascript for grid view checkbox Pin
umeshdaiya29-Jul-08 3:14
umeshdaiya29-Jul-08 3:14 
AnswerRe: javascript for grid view checkbox Pin
leppie29-Jul-08 4:51
leppie29-Jul-08 4:51 
QuestionCannot pass params! Any ideas? Pin
FruitBatInShades29-Jul-08 2:56
FruitBatInShades29-Jul-08 2:56 
AnswerRe: Cannot pass params! Any ideas? Pin
J4amieC29-Jul-08 3:00
J4amieC29-Jul-08 3:00 
GeneralRe: Cannot pass params! Any ideas? Pin
Luc Pattyn29-Jul-08 4:00
sitebuilderLuc Pattyn29-Jul-08 4:00 
GeneralRe: Cannot pass params! Any ideas? Pin
J4amieC29-Jul-08 4:27
J4amieC29-Jul-08 4:27 
GeneralRe: Cannot pass params! Any ideas? Pin
FruitBatInShades29-Jul-08 22:47
FruitBatInShades29-Jul-08 22:47 

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.