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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid control Order column MonthCalendar

Thread ID:





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

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
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)


End Sub

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

Visual Basic.Net 2003
Syncfusion version:

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.

Ragamathullah B.


Replied On February 22, 2012 10:46 AM UTC

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

.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.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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