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

Col Format in GridListControl

Thread ID:

Created:

Updated:

Platform:

Replies:

27075 Apr 6,2005 07:37 AM UTC Apr 6,2005 10:38 AM UTC Windows Forms 3
loading
Tags: GridControl
Ayman
Asked On April 6, 2005 07:37 AM UTC

I need to change Col format in GridListControl to be that format "dd/MM/yyyy hh:mm tt" First my GridListControl have DataSource from DataTable and I have field DataTaype (DateTime) And result appear in grid like that ''01/01/2005'' but I need it to be like that ''01/01/2005 10:15 AM'' So now how can I change this column format? I''m trying to use this glstRemarks.Grid.ColStyles(4).Format = "dd/MM/yyyy hh:mm tt" But its return an error "Additional information: Specified argument was out of the range of valid values." So what can I use to change this column format?

Administrator [Syncfusion]
Replied On April 6, 2005 09:28 AM UTC

You will not be able to do this using ColStyles. Instead, try handling the QueryCellInfo event on the embedded grid and handling things there.
 AddHandler GridListControl1.Grid.QueryCellInfo, AddressOf grid_QueryCellInfo
 

    Private Sub grid_QueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs)
        If e.ColIndex = 4 AndAlso e.RowIndex > 0 Then
            e.Style.Format = "dd/MM/yyyy hh:mm tt"
        End If
    End Sub

Ayman
Replied On April 6, 2005 10:11 AM UTC

hi Clay, Every time i asked about anything u told me use QueryCellInfo so why all of that properties included in this controls in GridListControl and DataBound and GridDataBoundGrid. Just for show.

Administrator [Syncfusion]
Replied On April 6, 2005 10:38 AM UTC

GridListControl.Grid and GridDataBoundGrid are both virtual grids. They do not really hold any data. Their datasource hold the data. This means they use QueryCellInfo to get at the data. If you want to change their behavior, then you also have to use QueryCellInfo, or else what you do will be stepped on by their QueryCellInfo work as it is completely dynamic. In some situations, the derived controls have specific properties to handle some things like GridBoundCOlumn,StyleInfo for a GridDataBoundGrid. But this only means the GridDataBoundGrid''s QueryCellInfo work is getting the information from these derived object properties.

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

;