Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Fixed column alignment
Fixed column alignment [message #22053] |
Mon, 15 June 2009 19:49  |
ricper75
Messages: 7 Registered: June 2009 Location: Italy
|
Promising Member |
|
|
I'm trying to change the alignment of a fixed AND merged cell.
I can't figure out how to do.
I attached a little image for better explaining what I would do.

I'd like the columns First and Second centered.
Before posting I tryed without any result both the SetFixed and the .AlignCenter() method (I'd also called .AlignCenter() for every col ) .
Nevertheless the Set method works in non fixed cells
I post the code here:
Any clues?
Thanks in advance.
p.s.
Many thanks for the BEST FREE GRID CONTROL EVER SEEN
FrmMain::FrmMain()
{
CtrlLayout(*this, "K *-* v. 0.0.1");
this->Sizeable(true).Zoomable(true);
this->mgrdMain.AddColumn("First").AlignCenter();
this->mgrdMain.AddColumn("First2");
this->mgrdMain.AddColumn("First3");
this->mgrdMain.AddColumn("First4");
this->mgrdMain.AddColumn("First5");
this->mgrdMain.AddColumn("First6");
this->mgrdMain.AddColumn("Second");
this->mgrdMain.AddColumn("Second2");
this->mgrdMain.AddRow("Col1", "Col2", "Col3", "Col4", "Col5", "Col6", "Col7", "Col8");
this->mgrdMain.SetFixedRows(2);
this->mgrdMain.JoinFixedCells(1,0,6,0);
this->mgrdMain.JoinFixedCells(7,0,8,0);
//this->mgrdMain.GetColumn(1).AlignCenter();
//this->mgrdMain.Set(0, 0, AttrText(AsString(1000)).Align(ALIGN_CENTER) );
//this->mgrdMain.SetFixed(0, 0, AttrText(AsString(1000)).Align(ALIGN_CENTER) );
this->mgrdMain.AddRow("R1", "134", "0.135", "0.134", "On", "100000", "", "");
this->mgrdMain.AddRow("R2", "234", "0.235", "0.234", "On", "100000", "0.235", "50000");
this->mgrdMain.AddRow("R3", "334", "0.335", "0.334", "Off", "100000", "", "");
}
-
Attachment: upp_grid.JPG
(Size: 17.90KB, Downloaded 630 times)
|
|
|
|
Re: Fixed column alignment [message #22162 is a reply to message #22150] |
Sat, 20 June 2009 21:22   |
|
ricper75 wrote on Fri, 19 June 2009 11:10 | anyone can help me?
Bye.
Rick
|
Hi!
Modify your code to:
this->mgrdMain.AddColumn("First").AlignCenter().HeaderAlignCenter();
this->mgrdMain.AddColumn("First2");
this->mgrdMain.AddColumn("First3");
this->mgrdMain.AddColumn("First4");
this->mgrdMain.AddColumn("First5");
this->mgrdMain.AddColumn("First6");
this->mgrdMain.AddColumn("Second").HeaderAlignCenter();
this->mgrdMain.AddColumn("Second2");
I see for the first time anyone is using joined cells especialy they're not documented. Joining is not 100% finished - however it works and I use this in my own applications as well (for example drag&drop columns do not fully works).
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 20:38:28 CEST 2025
Total time taken to generate the page: 0.01091 seconds
|