- Home
- Forum
- ASP.NET Web Forms (Classic)
- ItemTemplate align
ItemTemplate align
- Jun 13, 2012 09:32 AM UTC
- Jun 18, 2012 07:33 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.
Thanks
Fabio
<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;">
<tbody><tr>
<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>
</tr>
</tbody></table>
</div>
</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,
Fabio
Thanks
spaceImage_27858c2.rar
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;
GridGroupingControl1.TableDescriptor.Relations.Add(childrelationdescriptor);
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.
http://www.syncfusion.com/downloads/Support/DirectTrac/95502/2%20level%20hierarchy-1168793817.zip
Please let me know if you have any other questions or concerns.
Regards,
Sridhar.N
- 2 Replies
- 2 Participants
-
FA Fabio
- Jun 13, 2012 09:32 AM UTC
- Jun 18, 2012 07:33 AM UTC