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

DataGrid icons and sorting

Thread ID:

Created:

Platform:

Replies:

41799 Mar 12,2006 11:24 PM UTC Windows Forms 0
loading
Tags: FAQ
Administrator [Syncfusion]
Asked On March 12, 2006 11:24 PM UTC

Hi! I was just taking a look at your dataGrid examples, they have been really useful thanks! However, the example to add icons seems to fix the icons to a specific row of the data grid so that as the data is resorted the icons do not sort with it. I''m doing the following to try and attempt this based on your example, the "Type" columns basically gives an index value that corresponds to the icons I have loaded in the image list called "Icons". Even though I have forced my styles to be redone after a sort of the data grid the icons still seem stuck in place as per the original order. Just a theory, is this becasue the table actually doesn''t reorder, but the view of that table in the data grid does reorder? Any pointers you can give would be appreciated! thanks Chris Function MyGetImageIndexForRow(ByVal row As Integer) As Integer Dim dataTable As DataTable = CType(MusicDataGrid.DataSource.Tables(0), DataTable) Return dataTable.Rows(row).Item("Type") dataTable.Dispose End Function ..... Dim tmpc as DataColumn For Each tmpc In dataTable.Columns If tmpc.ColumnName = "Icon" Then Dim iconColumn As DataGridIconOnlyColumn iconColumn = New DataGridIconOnlyColumn(Icons, New delegateGetIconIndexForRow(AddressOf MyGetImageIndexForRow)) iconColumn.HeaderText = "" iconColumn.MappingName = "Icon" iconColumn.Width = Me.Icons.Images(0).Size.Width tableStyle.GridColumnStyles.Add(iconColumn) Exit For End If Next

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

;