| Query | Response |
| 1) Image & Name colum names are hidden but not Folder. | The ShowColumnHeaders will hide the 0th row in the grid whereas, the Folder column will be included in the next row based on the LayoutColumns of the grid. So, that the reported issue occurred. In order to, hide the column headers when the layout for the columns are added, we would suggest you to, hide the row manually by using the HideRows property. Please refer to the below code, Code example //To hide the column header row manually this.gridDataBoundGrid1.Model.HideRows[1] = true; |
| 2) Image is not displayed on cell [2,1] | Since, the columns are included in layout format, the ColStyle for the aligned columns (i.e. ImageIndex and Folder columns) will be same. So, to add the image for the ImageIndex column, we would suggest you to add the image in the data table itself by using the Byte[] array data type. Please refer the below code to add image in the data table, Code example //Creates a new Data Column, sets the Data Type and Column Name and adds to the Data Table. myDataColumn = new DataColumn(); //To set data type as Byte[] array myDataColumn.DataType = typeof(byte[]); myDataColumn.ColumnName = "ImageIndex"; myDataTable.Columns.Add(myDataColumn); for (int i = 0; i <= 10; i++) { myDataRow = myDataTable.NewRow(); //To add the image in the data table Byte[] imageArray = System.IO.File.ReadAllBytes(FindFile(@"flower" + i % 3 + ".jpg")); myDataRow["ImageIndex"] = imageArray; myDataRow["Name"] = "item " + i.ToString(); myDataRow["Folder"] = "fld " + i.ToString(); myDataTable.Rows.Add(myDataRow); } this.gridDataBoundGrid1.DataSource = myDataTable; |
| 3) Position of cell 'Folder' is not the expected one. it should start on column 2. | You can add the columns to its position as per your requirement by adding an empty column. We created a simple sample as per your requirement. Please make us of the below code and sample, Code example //To position the columns binder.LayoutColumns(new string[] { "ImageIndex", "Name", ".","", "Folder" }); // "." indicates a new row. |
| Query | Response |
| 2) It works too. In one of my cases it will do the job. In the other case, I need to display application icons from imagelist. So does the best way to use the ImageList is to get the image from ImageList and then convert it to Byte[] before inserting it in DataRow ? | As we updated earlier, the image will be loaded when the column type is Byte[] array and since, the column index for layout columns will be same when the row is separated with different section. So, the recommended way to add the image or icon for that specified column is to add the image/icon to the data source to populate the image in the grid. Also, we would suggest you to use the GridGroupingControl to avail the advanced feature that span the columns by using the ColumnSet collection. Please refer to the below UG to choose the best grid, |
| 3) OK. I learned that '-' is working to merge 2 horizontal cells. Is there a similar way for 2 vertical cells ? | The GridDataBoundGrid does not have the support to merge 2 vertical cells when the Layout for the columns are included. To achieve the scenario, the cells can be covered used QueryCoveredRange event. We modified the sample as per your requirement. Please refer to the below code and sample, Code example binder.LayoutColumns(new string[] {"ImageIndex", "Name", ".","","Folder" }); // "." indicates a new row. //Event triggering this.gridDataBoundGrid1.Model.QueryCoveredRange += Model_QueryCoveredRange; //Event customization private void Model_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e) { if (e.ColIndex == 1 && e.RowIndex % 2 == 0) { //To cover the cells e.Range = GridRangeInfo.Cells(e.RowIndex, e.ColIndex, e.RowIndex + 1, e.ColIndex); e.Handled = true; } } |
| 4) I've found the sample I was looking for, it's a GridGroupingControl : https://help.syncfusion.com/windowsforms/gridgrouping/feature-summary and the direct link on image I'm trying to reproduce : https://help.syncfusion.com/windowsforms/gridgrouping/Feature-Summary_images/Feature-Summary_img14.jpeg where is the sample application ? | We already included the sample in the Syncfusion control panel and you can avail the sample in your local machine from the below location, Dashboard location: <Insatll_Location>\Syncfusion\EssentialStudio\15.3.0.22\Windows\Grid.Grouping.Windows\Samples\Layout Customization\Record Customization Demo\CS Sample link: RecordCustomization |
| //To add the photo column to GridColumnSpanDescriptor with specified range. gridColumnSetDescriptor9.ColumnSpans.AddRange(newSyncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] { new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("Photo","R0C0:R1C0")}); gridColumnSetDescriptor9.Name = "ColumnSetPhoto"; //To add the GridColumnSetDescriptor to columnsets collection. this.gridGroupingControl1.TableDescriptor.ColumnSets.AddRange(newSyncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor[] { gridColumnSetDescriptor9}); |
| Query | Response |
| - full row select isn't working. Only Per-Cell-Selection is working (feature we don't need) | By default, the CurrentCell will be activated when the ListBoxSelectionMode is enabled. If you want to select the entire row without activating the current cell, the ListBoxSelectionCurrentCellOptions property can be set asHideCurrentCell. Please refer to the below code, Code example //To disable activating current cell on selection this.gridGroupingControl1.TableOptions.ListBoxSelectionCurrentCellOptions =GridListBoxSelectionCurrentCellOptions.HideCurrentCell; Moreover, if you want to disable the selection itself, the ListBoxSelectionMode can be set to None. Please make use of the below UG and KB to clear with the selection options, Screenshot Note Please refer to the above screenshot and confirm us that the screenshot meets your requirement. If not, provided us your requirement with simple screenshot which will helpful for us to provide a solution at the earliest. |
| - I still have on the top 'ArrayList : 16 items. How to hide it ? | In order to remove/disable the caption bar for the grid, the ShowCaption property can be set to false. Please make use of the below code and UG link, Code example //To disable the caption bar this.gridGroupingControl1.TopLevelGroupOptions.ShowCaption = false; |
| I'm trying to set in Italic the 3rd column (with the path) : | By default, the style will be applied for all the cells from entire table control based on the base style name. In order to set the font style for a particular column, the Appearance property for the column can be used. Moreover, theItalic property of GridStyleInfo can be used to set the italic for that column. Please make use of the below code and modified sample, Code example gridColumnDescriptor15.MappingName = "FirstName"; //To apply back color for the "FirstName" Column through column descriptor. gridColumnDescriptor15.Appearance.AnyRecordFieldCell.Interior = newSyncfusion.Drawing.BrushInfo(Color.LightSalmon); //To enable italic for the "FirstName" column at run time. this.gridGroupingControl1.TableDescriptor.Columns["FirstName"].Appearance.AnyRecordFieldCell.Font.Italic = true; Note Ensure that the columns are added properly to grid and MappingName/ColumnIndex for the column is provided properly. |