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. Image for the cookie policy date
close icon

What''s the simple solution to convert a .NET Data Grid to Syncfusion Grid

Hi, All, I wrote my own grid that inherits from .NET DataGrid and some event handling on the grid level, also wrote my own grid text column / table style / collections with column level event handling and row level painting - now it''s about the time to think about how to convert my data grid to Syncfusion based Grid, any one got some sample and ideas how this would work ?? Lot of thanks. regards, mark

2 Replies

AD Administrator Syncfusion Team March 9, 2004 05:01 PM UTC

DataGrid and GridDataBoundGrid are two very different things. DataGridColumnStyles serve some of the same functionality as GridBoundColumns. The order and inclusion of the columns in both grids are determined by the order the columns are added to these collections. In DataGrid, you normally derived a COlumnStyle to implement functionality like setting a backcolor or using a special font in that column. Well, in a GridDataBoundGrid, you do not have to override anything to set such properties on a column basis. You just set the GridBoundCOlumn.StyleInfo property for that column. If you want to do something at a cell level (like color a cell based on its value), then this would be another reason to derive a DataGridColumnStyle. But again, this is not necessary in a GridDataBoundGrid. Instead, you would handle the PrepareViewStyleInfo event, and there conditionally set e.Style.backColor based on, say e.Style.CellValue (or e.ColIndex or e.RowIndex or ???). The point I am trying to make is that I think you will essentially have to set gridDataBoundGrid1.DataSource, and then either set properties or handle particular events to get the functionality you had in DataGrid. I think it will be much less work than deriving DataGridColumnsStyles. Depending upon exactly what you did, you may have to do other things. When you run into a problem, you can use our Direct Trac support system to get help with the task


AD Administrator Syncfusion Team March 10, 2004 11:32 AM UTC

thanks a lot for ur suggestion, man, I did spent quite a mount of time to write my own column style and cell event handling, etc - now to be consistent with others, I have to convert to syncfusion grid if the amount of work is smaller and easier than I did by using .NET datagrid, etc - I''ll give a shot first and see how it goes, thanks again. >DataGrid and GridDataBoundGrid are two very different things. > >DataGridColumnStyles serve some of the same functionality as GridBoundColumns. The order and inclusion of the columns in both grids are determined by the order the columns are added to these collections. > >In DataGrid, you normally derived a COlumnStyle to implement functionality like setting a backcolor or using a special font in that column. Well, in a GridDataBoundGrid, you do not have to override anything to set such properties on a column basis. You just set the GridBoundCOlumn.StyleInfo property for that column. > >If you want to do something at a cell level (like color a cell based on its value), then this would be another reason to derive a DataGridColumnStyle. But again, this is not necessary in a GridDataBoundGrid. Instead, you would handle the PrepareViewStyleInfo event, and there conditionally set e.Style.backColor based on, say e.Style.CellValue (or e.ColIndex or e.RowIndex or ???). > >The point I am trying to make is that I think you will essentially have to set gridDataBoundGrid1.DataSource, and then either set properties or handle particular events to get the functionality you had in DataGrid. I think it will be much less work than deriving DataGridColumnsStyles. Depending upon exactly what you did, you may have to do other things. When you run into a problem, you can use our Direct Trac support system to get help with the task

Loader.
Live Chat Icon For mobile
Up arrow icon