irigsoft Posted November 14, 2022 Share Posted November 14, 2022 Hello, in my desktop application I add First Column in every DBgrid and show Row ID, now I want to make this in DrawColumnCell, but I don't have TRect here is my code on desktop, how to make this on uniGui ?: if TDBGrid (Sender).DataSource.DataSet.RecNo > 0 then begin TRY If TDBGrid (Sender).Columns [0].Title.Caption <> '№' then begin TDBGrid (Sender).Columns.Insert (0);//TColumn.Create(SelDBGrid.Columns); TDBGrid (Sender).Columns [0].Title.Alignment := taCenter; TDBGrid (Sender).Columns [0].Title.Caption := '№'; TDBGrid (Sender).Columns [0].Width := 24; TDBGrid (Sender).Columns [0].Alignment := taCenter; TDBGrid (Sender).Columns [0].Font.Color := clRed; TDBGrid (Sender).Columns [0].Font.Style := [fsBold]; end; if Column.Title.Caption = '№' then begin TDBGrid (Sender).Canvas.TextOut(Rect.Left + 2, Rect.Top, IntToStr(TDBGrid (Sender).DataSource.DataSet.RecNo)); end; EXCEPT END; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 14, 2022 Share Posted November 14, 2022 Hello, Why not just use it? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 14, 2022 Author Share Posted November 14, 2022 25 minutes ago, Sherzod said: Hello, Why not just use it? Here is result: is not work for me Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 14, 2022 Share Posted November 14, 2022 Are you using XTemplate? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 14, 2022 Author Share Posted November 14, 2022 no, I use Html text in row data Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 14, 2022 Share Posted November 14, 2022 Can you make a simple app to check? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 14, 2022 Author Share Posted November 14, 2022 3 hours ago, Sherzod said: Can you make a simple app to check? I am sorry. The project is complex, I don't have a way to separate Query from all functionality. How to make with TAdoQuery select statement from Grid examples and Demo Databases? example of my code: SELECT ('<H2>'+ T1."Name" + '</H2>' + '<ul><ul><h3 align="right">Price: ' + CAST (ROUND (T1."Price",2) as varchar (20)) + ', ' + lower (T1."Currency") + '</h3></ul></ul>' as ColName FROM T1 ); From Image above: The first grid column is the RowID, the second is ActionColumn, the third is an image (Blob field), the fourth is the HTML data of 3 columns: name, price, currency Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 14, 2022 Author Share Posted November 14, 2022 @Sherzod, thank You for your help. I found error in my code and now all is OK, I use in my Grid.Options := Grid.Options + [dgRowNumbers] 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.