User (Old forums)MemberMarch 3, 2004 at 8:29 amPost count: 23064
In some others grid i found the ExtendRightColumn property, which automatically extend the size of the last column to fill the width of the grid.
Is there someting similar in Xceed Grid 2?
Imported from legacy forums. Posted by Gian Luigi (had 3086 views)User (Old forums)MemberMarch 3, 2004 at 6:05 pmPost count: 23064
I asked the same question and got this sample code from Xceed.
Hope it helps you.
//Subscribe on these events in the Form_Load() section
foreach(Xceed.Grid.Column c in gridControl1.Columns)
c.WidthChanged += new EventHandler(this.Column_WidthChanged);
c.VisibleIndexChanged += new EventHandler(this.Column_VisibleIndexChanged);
//Add these event methods.
private void Column_WidthChanged(object sender, EventArgs e)
private void Column_VisibleIndexChanged(object sender, EventArgs e)
//Add this method.
private void ResizeLastColumn()
int spaceLeft = gridControl1.DisplayRectangle.Width – gridControl1.RowSelectorPane.Width;
for(int cpt = 0; cpt < gridControl1.Columns.Count – 1; cpt ++)
spaceLeft -= gridControl1.Columns.GetColumnAtVisibleIndex(cpt).Width;
gridControl1.Columns.GetColumnAtVisibleIndex(2).Width = spaceLeft;
Imported from legacy forums. Posted by Benny (had 434 views)User (Old forums)MemberMarch 4, 2004 at 2:43 amPost count: 23064
Thanks for your reply.
I try your code (i have converted it in VB.Net), but in ResizeLastColumn it considers ALL columns, even that not visible in the displayrectangle.
So Spaceleft is always negative and this don’t work for me.
Do you know if there is a method to know if a column is in the display rectangle?
Imported from legacy forums. Posted by Gian Luigi (had 211 views)User (Old forums)MemberMarch 24, 2004 at 2:42 amPost count: 23064
I’m sorry for replying so slowly.
Unfortunately i do not know if there is such a method, but maybe the Xceed staff know how to handle this problem.
Imported from legacy forums. Posted by Benny (had 4121 views)
- You must be logged in to reply to this topic.