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

How to find Panel in ItemTemplate?

Hi,

I am new to Syncfusion, and working on a project where we are deciding on whether to use ASP.net Grid control or Syncfusion.

We are trying to show the panel in the ItemTemplate on the button click in the row.

It would be great if you could show us how to find a control in the ItemTemplate of the GridGroupingControl.

Thanks & Regards
Rajiv Gopinath


1 Reply

RS Rajarajeswari S Syncfusion Team October 27, 2008 06:47 PM UTC


Hi Rajiv,

Sorry for the delay in getting back to you.

1. We are trying to show the panel in the ItemTemplate on the button click in the row:

Please refer the sample from the below link:

http://websamples.syncfusion.com/samples/Grid.Web/6.3.0.30/Grid_Web_GridInTemplate/main.htm

In the above sample:

1. Image button, GridGroupingControl is used as an ItemTemplate.
2. Clicking on the Image button changes the ImageUrl as well as load the Grid for the particular record.

2. Findout the ItemTemplate control:

ItemTemplate columns are defined using TemplateClass through code behind. By accessing the TemplateClass we can have a property to Findout the Template controls:

public class TemplateClass : ITemplate
{
private Control m_ctrlChildControl = null;
public Control childControl
{
get
{
return m_ctrlChildControl;
}
set
{
m_ctrlChildControl = value;
}
}
public TemplateClass(Control ctrlChildControl)
{
m_ctrlChildControl = ctrlChildControl;
}

public void InstantiateIn(Control container)
{
container.Controls.Add(m_ctrlChildControl);
}
}

TemplateClass temp = this.GridGroupingControl1.TableDescriptor.Columns[2].ItemTemplate;
Control cntrl = temp.childControl;

Please let me know if you have any other concerns.

Regards,
Raji



Loader.
Live Chat Icon For mobile
Up arrow icon