Hi..
I would like to center the template column , when it is resized..
Thanks in advance.
By..
Bala..
I do not undestand the question. What are you resizing? What would you like centered?
I have used UltraGrid to list data...There in i used an UltraGridColumn to display date and i would like to center this column (headertext & cellvalues)....
I did the above with using cssclass... But when the page is refreshed.. it doesn't center align the column
I have given the code here... Thanks in advance...
<igtbl:UltraWebGrid ID="gridInfoList" SkinID="CCEAdvancedGrid" runat="server" width="100%" Height="100%" OnDblClick="gridInfoList_DblClick" OnPageIndexChanged="gridInfoList_PageIndexChanged" EnableViewState="False"> <Bands> <igtbl:UltraGridBand> <AddNewRow View="NotSet" Visible="NotSet"></AddNewRow> <Columns> <igtbl:UltraGridColumn AllowGroupBy="No" AllowNull="False" AllowResize="Free" AllowUpdate="No" BaseColumnName="MainNodeID" CellMultiline="Yes" ChangeLinksColor="True" DataType="System.Int32" HeaderText="Section" Key="MainNodeID" Width="58px"> <Header Caption="Section"> </Header> <CellStyle Cursor="Hand"> </CellStyle> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn AllowGroupBy="No" HTMLEncodeContent="true" AllowNull="False" AllowResize="Free" AllowUpdate="No" BaseColumnName="MainNodeName" CellMultiline="Yes" ChangeLinksColor="True" HeaderText="Section Heading" Key="MainNodeID" Width="150px"> <Header Caption="Section Heading"> <RowLayoutColumnInfo OriginX="1" /> </Header> <CellStyle Cursor="Hand"> </CellStyle> <Footer> <RowLayoutColumnInfo OriginX="1" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn AllowGroupBy="No" AllowNull="False" AllowResize="Free" AllowUpdate="No" BaseColumnName="ModifiedDate" CellMultiline="Yes" ChangeLinksColor="True" HeaderText="Mod.Date" Key="MainNodeID" Width="80px" Format="dd-MMM-yy"> <Header Caption="Mod.Date"> <RowLayoutColumnInfo OriginX="2" /> </Header> <CellStyle Cursor="Hand"> </CellStyle> <Footer> <RowLayoutColumnInfo OriginX="2" /> </Footer> <CellStyle Cursor="Hand" CssClass ="rPadCol"><Padding Left="0px" /></CellStyle> <HeaderStyle CssClass ="rPadCol" /> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn AllowGroupBy="No" AllowNull="False" AllowResize="Free" AllowUpdate="No" BaseColumnName="ModifiedBy" CellMultiline="Yes" ChangeLinksColor="True" HeaderText="ModifiedBy" Key="MainNodeID" Width="150px"> <Header Caption="ModifiedBy"> <RowLayoutColumnInfo OriginX="3" /> </Header> <CellStyle Cursor="Hand"> </CellStyle> <Footer> <RowLayoutColumnInfo OriginX="3" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn Hidden="True" AllowGroupBy="No" AllowNull="False" AllowResize="Free" AllowUpdate="No" BaseColumnName="MainDescription" CellMultiline="Yes" ChangeLinksColor="True" HeaderText="" Width="150px"> <Header Caption=""> <RowLayoutColumnInfo OriginX="4" /> </Header> <CellStyle Cursor="Hand"> </CellStyle> <Footer> <RowLayoutColumnInfo OriginX="4" /> </Footer> </igtbl:UltraGridColumn> </Columns> </igtbl:UltraGridBand> </Bands> <DisplayLayout Name="ctl00xgridInfoList" AutoGenerateColumns="False"HeaderClickActionDefault="NotSet" NoDataMessage="No Sections for this company."
> <ClientSideEvents DblClickHandler="gridInfoList_DblClickHandler" CellClickHandler="gridInfoList_CellClickHandler" ColumnHeaderClickHandler="gridInfoList_ColumnHeaderClickHandler" /> </DisplayLayout> </igtbl:UltraWebGrid>
.rPadCol
{
text-align:center;
padding-left:0px;
padding-right:0px:
}
I defined it in css... and given link to that in my .ascx page
Is this the column you're trying to center?
balamuruganguru said: <igtbl:UltraGridColumn AllowGroupBy="No" AllowNull="False" AllowResize="Free" AllowUpdate="No" BaseColumnName="ModifiedDate" CellMultiline="Yes" ChangeLinksColor="True" HeaderText="Mod.Date" Key="MainNodeID" Width="80px" Format="dd-MMM-yy"> <Header Caption="Mod.Date"> <RowLayoutColumnInfo OriginX="2" /> </Header> <CellStyle Cursor="Hand"> </CellStyle> <Footer> <RowLayoutColumnInfo OriginX="2" /> </Footer> <CellStyle Cursor="Hand" CssClass ="rPadCol"><Padding Left="0px" /></CellStyle> <HeaderStyle CssClass ="rPadCol" /> </igtbl:UltraGridColumn>
This isn't a templated column; it's a regular WebGrid column that (apparently) is formatted to display dates.
I assume that the "rPadCol" CSS class is where you're defining the center alignment? If so, what's its definition? If not, what are you doing to try to align the text?
If this is working right on initial render, but not on a postback, then I suspect there's something you're doing for intiial rendering that you somehow need to repeat on a postback. I notice that you've turned the grid's EnableViewState property to false; does it make a difference if you turn it back to true?