Column hosting

Hi,

Is there anyway that a column in the SfDataGrid can host another SfDataGrid. I've looked at creating a custom column, but this doesn't seem possible with this particular control. If not possible, maybe this could be added as a future feature?


Regards

Jeremy

7 Replies 1 reply marked as answer

MA Mohanram Anbukkarasu Syncfusion Team March 22, 2021 12:41 PM UTC

Hi Jeremy, 

Thanks for using Syncfusion controls.  

We are little unclear with your requirement. Whether you need to directly display SfDataGrid in each cells of a column or you need to open a dropdown and inside which you have to display SfDataGrid.  If possible can you please provide a image illustration to explain your requirement. It will be more helpful for to understand your requirement and to check the possibilities to achieve it. 

Regards, 
Mohanram A. 



JE Jeremy March 22, 2021 01:08 PM UTC

Thanks for your reply, Mohanram.

What I'd like is for something akin to a GridComboBoxColumn that would host a PopUpControl. In my case this control would be a SfDataGrid. So, each time a cell in the column was clicked the SfDataGrid would 'dropdown'. Outside of the grid at present I'm using the ComboDropDown control which when dropped down displays a SfDataGrid. This works great, but I now need something similar to work within the grid itself. The SfDataGrid's GridComboBoxColumn is based on the SfComboBox, but only has a limited number of properties exposed, as opposed to the standalone control, otherwise this would most likely work.

Hope this makes it clearer.

Regards

Jeremy


MA Mohanram Anbukkarasu Syncfusion Team March 23, 2021 01:46 PM UTC

Hi Jeremy,  

Thanks for the update.   

We are currently validating this. We will check and update with further details on March 25, 2021. We appreciate your patience until then.   

Regards,  
Mohanram A. 



MA Mohanram Anbukkarasu Syncfusion Team March 25, 2021 11:38 AM UTC

Hi Jeremy, 

Thank you for your patience. 

We have analyzed your requirement. We have already considered your requirement as “Provide the support for MultiColumnComboBox column” in SfDataGrid and logged feature request for the same. We will implement this feature in any of our upcoming release.  
  
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.   
   
Thank you for requesting this feature and helping us define it. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.   
    
You can also communicate with us regarding the open features any time using our Feature Report page.    

If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count.  

Regards, 
Mohanram A. 



MA Mohanram Anbukkarasu Syncfusion Team April 28, 2021 06:45 AM UTC

Hi Jeremy, 

We have checked your update in the feedback.  

We have prepared a sample to achieve your requirement to show SfDataGrid in a dropdown of a column by creating a custom column using ComboDropDown control as edit element as shown in the following code example.  

Code example :  

this.sfDataGrid.CellRenderers.Add("DropDownDataGrid", new GridDropDownDataGridCellRenderer(this.sfDataGrid)); 
 
sfDataGrid.Columns.Add(new GridDropDownDataGridColumn() { MappingName = "ShipCityID", HeaderText = "Ship City", DataSource = new CountryInfoRepository().Cities }); 
 
 
public class GridDropDownDataGridColumn : GridColumn 
{ 
 
    public GridDropDownDataGridColumn() 
    { 
        SetCellType("DropDownDataGrid"); 
    } 
 
    public IEnumerable DataSource { get; set; } 
} 
 
public class GridDropDownDataGridCellRenderer : GridVirtualizingCellRendererBase<ComboDropDown> 
{ 
    SfDataGrid DataGrid { get; set; } 
 
    public GridDropDownDataGridCellRenderer(SfDataGrid dataGrid) 
    { 
        DataGrid = dataGrid; 
    } 
 
    protected override void OnRender(Graphics paint, Rectangle cellRect, string cellValue, CellStyleInfo style, DataColumnBase column, RowColumnIndex rowColumnIndex) 
    { 
        base.OnRender(paint, cellRect, cellValue, style, column, rowColumnIndex); 
    } 
 
    protected override void OnInitializeEditElement(DataColumnBase column, RowColumnIndex rowColumnIndex, ComboDropDown uiElement) 
    { 
        Rectangle editorRectangle = GetEditorUIElementBounds(); 
        uiElement.Size = editorRectangle.Size; 
        uiElement.Location = editorRectangle.Location; 
        uiElement.DropDownWidth = 300; 
 
        SfDataGrid dropDownDataGrid = new SfDataGrid() 
        { 
            DataSource = (column.GridColumn as GridDropDownDataGridColumn).DataSource, 
        }; 
 
        uiElement.PopupControl = dropDownDataGrid; 
 
        this.TableControl.Controls.Add(uiElement); 
        uiElement.Focus(); 
 
        base.OnInitializeEditElement(column, rowColumnIndex, uiElement); 
    } 
} 


Please have a look at this sample and let us know if you have any concerns in this.  

Regards, 
Mohanram A. 


Marked as answer

JE Jeremy April 28, 2021 10:01 AM UTC

Mohanram,


Thanks for taking the time to provide this sample. I will try to utilize this in my project as soon as practicable.


Regards

Jeremy




MA Mohanram Anbukkarasu Syncfusion Team April 29, 2021 04:57 AM UTC

Hi Jeremy, 

Thanks for the update.  

Regards, 
Mohanram A. 


Loader.
Up arrow icon