We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid control Order column MonthCalendar

Thread ID:

Created:

Updated:

Platform:

Replies:

102610 Feb 15,2012 08:55 AM UTC Feb 28,2012 10:33 AM UTC WinForms 3
loading
Tags: GridControl
muii
Asked On February 15, 2012 08:55 AM UTC

Hello.
I use this procedure to order a control grid by clicking on the header.

Public Sub OrderCol(ByRef grdGrid As Syncfusion.Windows.Forms.Grid.GridControl, ByVal col As Integer)
Dim style As New GridStyleInfo
Dim dir As ListSortDirection =ListSortDirection.Ascending
Dim col1 As Integer

If grdGrid.CurrentCell.IsEditing Then
grdGrid.CurrentCell.EndEdit()
End If

style.Tag = ""

While col1 <= grdGrid.ColCount
If col1 <> col AndAlso grdGrid(0, col1).CellType = "ColumnHeaderCell" Then
grdGrid(0, col1).CellType = "Header"
Exit While
End If
col1 += 1
End While

grdGrid(0, col).CellType = "ColumnHeaderCell"

If grdGrid(0, col).HasTag Then
If CType(grdGrid(0, col).Tag, ListSortDirection) = ListSortDirection.Ascending Then
dir = ListSortDirection.Descending
End If
End If

grdGrid(0, col).Tag = dir

grdGrid.Data.SortByColumn(col, dir)

grdGrid.Refresh()

End Sub


But when the column is of type 'MonthCalendar' does not sort correctly by date. How I can do to sort it?





Environment:
Visual Basic.Net 2003
Syncfusion version: 4.4.0.51




Ragamathulla B [Syncfusion]
Replied On February 18, 2012 04:20 PM UTC

Hi Muii,

Thank you for your interest in syncfusion products.

You can sort the DateTime column by declare "cellValueType". please refer to the attached sample which illustrates the same.

Let me know if you have any further concerns.

Regards,
Ragamathullah B.



CS_7d51bbad.zip

muii
Replied On February 22, 2012 10:46 AM UTC

Perfect!
We must set the property "cellValueType" to DateTime
In addition the property "CellValue" must contain a variable of type DateTime.

example:
.CellValue = CDate ("10/02/2012")


Asarudheen S [Syncfusion]
Replied On February 28, 2012 10:33 AM UTC

Hi Mulli,

Thanks for the update.

When you set the cell value type to the column ,all cell value would be the date time. Here we dont need any conversion.

Please let us know if you have any other concerns.

Regards,
Asarudheen.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;