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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ItemTemplate align

Thread ID:





103974 Jun 13,2012 09:32 AM UTC Jun 18,2012 07:33 AM UTC ASP.NET Web Forms (Classic) 2
Tags: GridGroupingControl
Asked On June 13, 2012 09:32 AM UTC


how i can align an item in an template column? I have the same problem in a related child table. I have a chechbox and i want toput it in the center of the column.


Replied On June 15, 2012 07:42 AM UTC

I have also an another problem. I put a NumericTextBox (or a CurrencyTextBox) as EditItemTemplate in a child table, but when i go in add new record mode the new row put the textbox not in the middle of  cell but at the bottom. The problem is that an   is rendered in cell rendering and this put the numerictextbox in a wrong position. This is the HTML of TD that was rendered by grid control:

<td valign="middle" class=" GridOffice2007BlueSelectedUfRowCells" id="MainContent" style=""> <div id="MainContent_hack_2" style="-moz-box-sizing: border-box;">
                        <input type="hidden" id="MainContent_txtMinuti_2_hidden" name="MainContent_txtMinuti_2_hidden"><div style="width: 60px; display: block; height: 22px;" dir="ltr" id="MainContent_txtMinuti_2">
                            <table cellspacing="0" cellpadding="0" style="width:60px;background-color:White;">
                                    <td align="right" style="width:100%;padding:0px;border-left:1px solid #808080;border-top:1px solid #808080;border-bottom:1px solid #FFFFFF;border-right:1px solid #FFFFFF;"><div style="border-left: 1px solid rgb(64, 64, 64); border-width: 1px; border-style: solid; border-color: rgb(64, 64, 64) rgb(212, 208, 200) rgb(212, 208, 200) rgb(64, 64, 64); height: 19px;"><input type="text" style="text-align: right; width: 58px; border: 0px none; padding: 0px; margin: 0px; height: 21px;" title="Range of values: from 0 to 1,79769313486232E+308" id="MainContent_txtMinuti_2_text_2" value="0" name="ctl00$MainContent$GridGroupingControl1EditCell51$txtMinuti$text"></div></td>


With Dropdownlist i haven't any problem it's all ok. I add the control dynamically at run time in the child grid.

How i can fix it?
Thanks in advice,


Sridhar N [Syncfusion]
Replied On June 18, 2012 07:33 AM UTC

Hi Fabio,

Thanks for your interest in Syncfusion products.

Your requirement to align the element can be achieved by setting the properties VerticalAlignment, HorizontalAlignment. Please refer the below code snippet.


[Codebehind – C#]

GridRelationDescriptor childrelationdescriptor = new GridRelationDescriptor();

childrelationdescriptor.ChildTableName = "Product";

childrelationdescriptor.RelationKind = RelationKind.RelatedMasterDetails;

childrelationdescriptor.RelationKeys.Add("Category ID", "Category ID");

childrelationdescriptor.ChildTableDescriptor.AllowNew = true;


this.GridGroupingControl1.Engine.SourceListSet.Add("Category", GetParent);

this.GridGroupingControl1.Engine.SourceListSet.Add("Product", GetDetail);

childrelationdescriptor.ChildTableDescriptor.Columns.FindByMappingName("Check").Appearance.AnyRecordFieldCell.VerticalAlignment = GridVerticalAlignment.Middle;

childrelationdescriptor.ChildTableDescriptor.Columns.FindByMappingName("Check").Appearance.AnyRecordFieldCell.HorizontalAlignment = GridHorizontalAlignment.Center;

this.GridGroupingControl1.DataMember = "DefaultView";

this.GridGroupingControl1.DataSource = GetParent;

this.GridGroupingControl1.TableDescriptor.Name = "Category";


For your convenience, we have created sample and the same can be downloaded from the following link.



Please let me know if you have any other questions or concerns.







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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon