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.
Unfortunately, activation email could not send to your email. Please try again.

Insert RowBtnTemplate

Thread ID:

Created:

Updated:

Platform:

Replies:

81059 May 11,2009 09:15 AM May 14,2009 09:37 AM ASP.NET Web Forms (Classic) 3
loading
Tags: Grouping
Administrator [Syncfusion]
Asked On May 11, 2009 09:15 AM

Insert check box in the main grid, but the two internal grids failed. How should I do?

Rekha P [Syncfusion]
Replied On May 12, 2009 05:59 AM

Hi Nabia,

Thank you for your interest in Syncfusion Products.

I am afraid that I am not able to reproduce the issue reported by you. I have created a simple sample using CheckBox RowBtnTemplate with two Grids to test this issue and it is available in the below link.
http://files.syncfusion.com/support/GGC.Web/7.2.0.20/F81059/main.htm

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Please let me know if you have any other concerns.

Thanks,
Rekha

Administrator [Syncfusion]
Replied On May 13, 2009 01:49 PM

Thanks for the help, solved part of my problem. I gridgroupingcontrol hierarchical (2 grids internal), need to enter the RowBtnTemplate these internal grids and display the check box to check all the lines of the grid. How?

Rekha P [Syncfusion]
Replied On May 14, 2009 09:37 AM

Hi Nabia,

When Parent-Children form of hierarchy Grid is defined, then the checkbox RowBtnTemplate can be specified in the form of checkbox template and binded for both parent and child Grids in QueryCellStyleInfo event. Please refer the code snippet to achieve this.

protected void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
//check for Parent Grid column to bind checkbox.
if (e.TableCellIdentity.Column.Name == "parentID")
{
CheckBox cb = new CheckBox();
cb.ID = "CheckBox1";

//Create a Template by implementing ITemplate interface and assign it to be the ItemTemplate for the column that needs to have a CheckBox.
TemplateClass mytemp = new TemplateClass(cb);
e.TableCellIdentity.Column.ItemTemplate = mytemp;
e.Handled = true;
}
if (e.TableCellIdentity.Column.Name == "childID")
{
CheckBox cb = new CheckBox();
cb.ID = "CheckBox2";

//check for Child Grid column to bind checkbox.
//Create a Template by implementing ITemplate interface and assign it to be the ItemTemplate for the column that needs to have a CheckBox.
TemplateClass mytemp = new TemplateClass(cb);
e.TableCellIdentity.Column.ItemTemplate = mytemp;
e.Handled = true;
}
}
}
public class TemplateClass : ITemplate
{
private Control m_ctrlChildControl = null;
public TemplateClass(Control ctrlChildControl)
{
m_ctrlChildControl = ctrlChildControl;
}

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

Please refer a sample below which illustrates the above.
http://files.syncfusion.com/support/GGC.Web/7.2.0.20/F81059_1/main.htm

Please let me know if you have any other concerns.

Thanks,
Rekha

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;