This is a migrated thread and some comments may be shown as answers.

How To Align the grid size

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Anto (DLL Version : 2008.3.1314.35) asked on 27 Mar 2009, 12:00 PM
Hi All

I have a radgrid with the header and item been taken from code behind.

In the .cs I have set the width

My Code:

protected

void rgvReport_ColumnCreated(object source, GridColumnCreatedEventArgs e)

 

{

 

if (e.Column is GridBoundColumn && !(e.Column.IsBoundToFieldName("Project/Date")))

 

{

e.Column.HeaderStyle.HorizontalAlign =

HorizontalAlign.Center ;

 

e.Column.ItemStyle.HorizontalAlign =

HorizontalAlign.Right;

 

e.Column.HeaderStyle.Width = 55;

e.Column.ItemStyle.Width = 55;

 

 

}

 

else

 

{

e.Column.HeaderStyle.Width = 70;

e.Column.ItemStyle.Width = 70;

}

}

But the header width is different from the Item width.

Please could anybody tell me how to rectify this problem.

Thank you

-Anto

1 Answer, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 27 Mar 2009, 07:34 PM
Anto-

Have you tried just setting the Header width from code-behind? I think that setting the Header will automatically affect the width of the Items in that column. Give that a try and see what happens.

-Todd
Tags
Grid
Asked by
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Answers by
Todd Anglin
Top achievements
Rank 2
Share this question
or