Forum > Packages and Libraries
DbGRid how i can show Header of Column put in 2 rows
(1/1)
eldonfsr:
Hello is possible in DBgrid columns headers on 2 lines title
ondrawcell i get put information in to rows but not in title
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TFormPo.DBGDetPoDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);begin if (Column.Index = 0 )then begin DBGDetPo.Canvas.FillRect(Rect); DBgDetPo.Canvas.TextOut(Rect.Left,Rect.Top,DBGDetPo.DataSource.DataSet.FieldByName('ItemNumber').AsString ); DBgDetPo.Canvas.TextOut(Rect.Left,Rect.Top+16,DBGDetPo.DataSource.DataSet.FieldByName('WareHouseCode').AsString ); DBgDetPo.Canvas.TextOut(Rect.Left+50,Rect.Top+16,DBGDetPo.DataSource.DataSet.FieldByName('UnitOfMeasure').AsString ); end; if (Column.Index = 1 )then begin DBGDetPo.Canvas.FillRect(Rect); DBgDetPo.Canvas.TextOut(Rect.Left,Rect.Top,DBGDetPo.DataSource.DataSet.FieldByName('Description').AsString ); DBgDetPo.Canvas.TextOut(Rect.Left,Rect.Top+16,DBGDetPo.DataSource.DataSet.FieldByName('QtyOrdered').AsString ); DBgDetPo.Canvas.TextOut(Rect.Left+50,Rect.Top+16,DBGDetPo.DataSource.DataSet.FieldByName('QtyReceived').AsString ); end; if (Column.Index = 3 )then begin DBGDetPo.Canvas.FillRect(Rect); DBgDetPo.Canvas.TextOut(Rect.Left,Rect.Top,DBGDetPo.DataSource.DataSet.FieldByName('UseTax').AsString ); DBgDetPo.Canvas.TextOut(Rect.Left+30,Rect.Top,DBGDetPo.DataSource.DataSet.FieldByName('RequiredDate').AsString ); DBgDetPo.Canvas.TextOut(Rect.Left,Rect.Top+16,DBGDetPo.DataSource.DataSet.FieldByName('QtyBckOrdrd').AsString ); DBgDetPo.Canvas.TextOut(Rect.Left+50,Rect.Top+16,DBGDetPo.DataSource.DataSet.FieldByName('UnitCost').AsString ); end; if (Column.Index = 4 )then begin DBGDetPo.Canvas.FillRect(Rect); DBgDetPo.Canvas.TextOut(Rect.Left,Rect.Top,DBGDetPo.DataSource.DataSet.FieldByName('GLAccount').AsString ); DBgDetPo.Canvas.TextOut(Rect.Left,Rect.Top+16,DBGDetPo.DataSource.DataSet.FieldByName('QtyBckOrdrd').AsString ); end; end; I need put title of column in two rows...
Zvoni:
i think to remember, there was a solution in the database-subforum, but no idea how far in the past that was.
IIRC, it had to do either with Fixed rows or with word-wrapping in a single cell
eldonfsr:
Thanks Zvoni , I remember see something about that but now when i need i can find or remember where was... I think some body implement that and share info or tip about it...
Thanks..
paweld:
RxDBGrid (RX components package) has the ability to multiline header
eldonfsr:
Wow RX never tried l lie that let me make test....
thanks...
Navigation
[0] Message Index