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

GridDataBoundGrid with a panel as a custom cell

Hi,

I have a binded GridDataBoundGrid and I would like to have my own panel as a cell contain for all cells of a column. This panel will also update the cell value. Please help me to do it.

Thanks,
Catalin

5 Replies

AK Arun Kumar V Syncfusion Team September 13, 2013 03:52 AM UTC

Hi Catalin,

Thanks for your interest in Syncfusion products.

We could not able to get the required specification clearly. Could you please confirm us whether you are looking to bind a panel to the GDBG cells. For example having the GDBG row 2 with your custom panel?. Could you please elaborate your scenario.

Regards,

Arun. 



CC Catalin Croitoru September 13, 2013 07:21 AM UTC

Hi Arun,

My scenario is like this: I have a GridDataBoundGrid with DataSource a IList<MyObject>. MyObject class has a property of MyPropertyType (our own class). I want for column of MyPropertyType the cell to contain my own custom container (my class) that could contain any control. In this custom control I have buttons and need to have click event for each row button.

I hope it is more clear now, if you have questions please let me know.

Thank you,
Catalin


AK Arun Kumar V Syncfusion Team September 17, 2013 03:55 AM UTC

Hi Catalin,

Thanks for the update.

If your intention is to embed a user control in a cell, please refer to the following sample in the dashboard.

Grid\Custom Cell Type\Drop-Down Form and User Control Demo

This demo will guide you to create a custom cell control that places a drop-down form or a user control in a cell.

 

Another option is just declare a control in the form and assign  the Control as celltype for a cell like below

            EditControl editControl = new EditControl();

            this.gridControl1[2, 2].CellType = GridCellTypeName.Control;

            this.gridControl1[2, 2].Control = editControl;

In this you can set your own custom control instead of EditControl and can assign it in the same way

Please let me know if this helps

Regards,

Kalai



CC Catalin Croitoru September 24, 2013 07:57 AM UTC

Hi Kalai,

Thank you for your response, but  I think it is a confusion. I don't use GridControl, I use GridDataBoundGrid. Your solution doesn't fit with my grid. My GridDataBoundGrid is bind to a BindingList (DataSource), so I need a solution to apply a custom control for a column for all rows automatically (not looping over a list in an event).

Thanks,
Catalin


AK Arun Kumar V Syncfusion Team September 30, 2013 03:22 AM UTC

Hi Catalin,

Thanks for the update.

Query:

I need a solution to apply a custom control for a column for all rows automatically (not looping over a list in an event)

Thanks for sharing the information. You could make use of the following Querycellinfo event. This event will be triggered continuously. So please make use of the following event.

 

Code Snippet:

this.gridDataBoundGrid1.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);

 

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

{

if(e.ColIndex==5)//The Colindex of the custom control.

{

e.Style.Control =//The respective control u are trying to bind.

}

}

 

Please let me know if you have any concerns.

Regards,

Arun.


Loader.
Live Chat Icon For mobile
Up arrow icon