Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Row autoheight with LineEdit 
	
		
		
			| Row autoheight with LineEdit [message #40842] | 
			Mon, 23 September 2013 08:30   | 
		 
		
			
				
				
				
					
						  
						iST1
						 Messages: 107 Registered: August 2013 
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	| 
		If we set LineEdit as row cell with Edit method and Editing(true), then how to increase row height to view all lines without Popup when hover?
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: Row autoheight with LineEdit [message #40902 is a reply to message #40842] | 
			Sat, 05 October 2013 16:59    | 
		 
		
			
				
				
				
					
						  
						iST1
						 Messages: 107 Registered: August 2013 
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		The possible solution is inheritance from  from LineEdit and redefine NewScrollPos method, but my attempt failed: 
class AppLineEdit : public LineEdit {
public:
	AppLineEdit(GridCtrl *grid) : grid_(grid) {}
		
	void NewScrollPos() {
		/*
		//how to get new heigth for SetRowHeight?		int ir = grid_->GetRowId() + 1;
		GridCtrl::ItemRect &row = grid_->GetRow(ir);
		Rect r = GetScreenView();
		grid_->SetRowHeight(ir, r.GetHeight());//2 * grid_->GetDefaultRowHeight());*/
	}
	
private:
	GridCtrl *grid_;
};
	
GUI_APP_MAIN
{	
	TopWindow wnd;
	GridCtrl grid;
	
	LineEdit edit(&grid);
	grid.AddColumn("Col1").Edit(edit);
	grid.Editing()
		.Sorting(false)
		.OneClickEdit();
	grid.AddRow();
	grid.Set(0, 0, "Row1");
	grid.AddRow();
	grid.Set(1, 0, "Row2");
	wnd.Add(grid.SizePos())	;
	wnd.Run();
}
 
		
		
		[Updated on: Sat, 05 October 2013 17:00] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 09:02:14 CET 2025 
 Total time taken to generate the page: 0.05074 seconds 
 |