Click here to Skip to main content
15,920,896 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Display Windows logoff dialog box Pin
User 17164928-May-06 15:16
professionalUser 17164928-May-06 15:16 
GeneralRe: Display Windows logoff dialog box Pin
setedivento8-May-06 22:52
setedivento8-May-06 22:52 
GeneralRe: Display Windows logoff dialog box Pin
setedivento9-May-06 4:07
setedivento9-May-06 4:07 
GeneralRe: Display Windows logoff dialog box Pin
User 17164929-May-06 7:43
professionalUser 17164929-May-06 7:43 
GeneralRe: Display Windows logoff dialog box Pin
setedivento9-May-06 13:15
setedivento9-May-06 13:15 
Questionformat(string, "dd/MM/yyyy") as date Pin
pptadam7-May-06 4:32
pptadam7-May-06 4:32 
AnswerRe: format(string, "dd/MM/yyyy") as date Pin
Paul Conrad7-May-06 5:02
professionalPaul Conrad7-May-06 5:02 
AnswerRe: format(string, "dd/MM/yyyy") as date Pin
Guffa7-May-06 5:41
Guffa7-May-06 5:41 
Questionmsfgrid in VB.net Pin
viji]7-May-06 1:49
viji]7-May-06 1:49 
AnswerRe: msfgrid in VB.net Pin
Mekong River7-May-06 5:37
Mekong River7-May-06 5:37 
Questiondatagridview columns text alignment Pin
G723607-May-06 1:30
G723607-May-06 1:30 
AnswerRe: datagridview columns text alignment Pin
Mekong River7-May-06 5:42
Mekong River7-May-06 5:42 
QuestionExtract Data from A WebSite through a WebBrowser Control? Pin
TehCheeze7-May-06 0:45
TehCheeze7-May-06 0:45 
AnswerRe: Extract Data from A WebSite through a WebBrowser Control? Pin
Kessica8-May-06 1:34
Kessica8-May-06 1:34 
QuestionSql File in DLL problem Pin
anom2m6-May-06 23:37
anom2m6-May-06 23:37 
AnswerRe: Sql File in DLL problem Pin
Rizwan Bashir7-May-06 21:34
Rizwan Bashir7-May-06 21:34 
GeneralRe: Sql File in DLL problem Pin
anom2m17-May-06 0:45
anom2m17-May-06 0:45 
GeneralRe: Sql File in DLL problem Pin
Rizwan Bashir17-May-06 5:32
Rizwan Bashir17-May-06 5:32 
QuestionA question about event handlers Pin
carloqueirolo6-May-06 21:18
carloqueirolo6-May-06 21:18 
AnswerRe: A question about event handlers Pin
Robert Rohde6-May-06 21:51
Robert Rohde6-May-06 21:51 
GeneralRe: A question about event handlers Pin
carloqueirolo6-May-06 22:04
carloqueirolo6-May-06 22:04 
GeneralRe: A question about event handlers Pin
Robert Rohde7-May-06 20:26
Robert Rohde7-May-06 20:26 
GeneralRe: A question about event handlers Pin
carloqueirolo7-May-06 21:15
carloqueirolo7-May-06 21:15 
QuestionDataGridView - SortCompare event not firing! Pin
nzmike6-May-06 18:08
nzmike6-May-06 18:08 
Hi all,

I have a Winforms 2.0 app in which I have a DataGridView which is populated from my own data objects (ie: from my own classes, not from a database or strongly typed dataset). The DGV is readonly so no editing or adding new rows can be done. Since some of the columns need to have a custom sort I set the SortMode property on those columns to "Programmatic" and then added the following event handler to the code:

Private Sub dgvMeetings_SortCompare(ByVal sender As System.Object, ByVal e As DataGridViewSortCompareEventArgs) Handles dgvMeetings.SortCompare

'Try to sort based on the columns in the current column.
e.SortResult = System.String.Compare(e.CellValue1.ToString(), e.CellValue2.ToString())

'If the cells are equal, sort based on the race start time column
If e.SortResult = 0 Then
e.SortResult = System.String.Compare(dgvMeetings.Rows(e.RowIndex1).Cells("RaceDate").Value.ToString(), _ dgvMeetings.Rows(e.RowIndex2).Cells("RaceDate").Value.ToString())
End If

e.Handled = True

End Sub

However, this event is simply not firing at all... I can click on the column headers until I'm blue in the face and the event never fires. The columns in the DGV that are set to sort automatically work fine so would anyone know why SortCompare is not working? I also tried adding an AddHandler which pointed to the same method (without the "Handles ..." of course) and it still ignores it. I actually got the code above from the MS document about the DGV (at http://download.microsoft.com/download/5/6/4/5646742C-3EB7-48F7-BFB3-CC295D618CF9/DataGridView%20FAQ.doc) in which it says this is the way to custom sort unbound data - but it doesn't seem to work for me... anyone know what I might be missing here?

TIA for any help...

Mike



-- modified at 0:13 Sunday 7th May, 2006
AnswerRe: DataGridView - SortCompare event not firing! Pin
nzmike6-May-06 20:04
nzmike6-May-06 20:04 

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.