Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Fixed column alignment
Fixed column alignment [message #22053] Mon, 15 June 2009 19:49 Go to next message
ricper75 is currently offline  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.

index.php?t=getfile&id=1792&private=0

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 560 times)
Re: Fixed column alignment [message #22150 is a reply to message #22053] Fri, 19 June 2009 17:10 Go to previous messageGo to next message
ricper75 is currently offline  ricper75
Messages: 7
Registered: June 2009
Location: Italy
Promising Member
anyone can help me?

Bye.
Rick
Re: Fixed column alignment [message #22162 is a reply to message #22150] Sat, 20 June 2009 21:22 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

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 Smile 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).
icon14.gif  Re: Fixed column alignment [message #22189 is a reply to message #22162] Tue, 23 June 2009 16:23 Go to previous message
ricper75 is currently offline  ricper75
Messages: 7
Registered: June 2009
Location: Italy
Promising Member
Ta-daaa!!!

index.php?t=getfile&id=1812&private=0

clap clap clap fiiiiuu clap fiiiiuu clap clap clap clap clap
Laughing

Thanks
Rick
Previous Topic: Grid Search Color on XP = very hard to read
Next Topic: I found a bug, please help
Goto Forum:
  


Current Time: Sun Apr 28 21:46:09 CEST 2024

Total time taken to generate the page: 0.05859 seconds