mos Posted February 13, 2018 Author Share Posted February 13, 2018 Hi Delphi Developer, I noticed in this thread http://forums.unigui.com/index.php?/topic/9122-tunidbgrid-color-combo/ you had created a color picker for DBGrid is it possible to implement this for a StringGrid rather than my idea above of using a TUniColorPalette? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 13, 2018 Share Posted February 13, 2018 Hi, I need to check it Best regards, Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2018 Share Posted February 22, 2018 Hi, Can you try this approach for now?: 1. Follow the steps as in this post: http://forums.unigui.com/index.php?/topic/9122-tunidbgrid-color-combo/ 2. UniDBGrid1 -> Columns -> "comboColor" column: Editor -> UniComboBox1 function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts) { var me = sender; columns[1].renderer = function(v) { return '<span style="float: left; width: 33px; height: 15px; background: ' + getHexa(v) + '"> </span> ' + v; } } MainForm -> OnReady: procedure TMainForm.UniFormReady(Sender: TObject); begin UniStringGrid1.JSInterface.JSCall('columnManager.columns[1].setEditor', [UniComboBox1.JSControl]) end; Result: Best regards, Quote Link to comment Share on other sites More sharing options...
mos Posted April 13, 2018 Author Share Posted April 13, 2018 Hi Delphi Developer, I've noticed that if I use this code you provide: UniStringGrid1.JSInterface.JSCode(#1'.rc[2][2]="background-color:green; color:white";'#1'.view.refresh();'); Using the above as an example the cell[2,2] will have a background color of green but if you highlight this row and have row select set to True, the row selection bar is not visible in cell[2,2] but is visible in cells that don't use the above code? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 13, 2018 Share Posted April 13, 2018 Hello, Can you please specify which build of UniGUI are you usong?! Quote Link to comment Share on other sites More sharing options...
mos Posted April 13, 2018 Author Share Posted April 13, 2018 Build 1413. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 13, 2018 Share Posted April 13, 2018 And please, can you capture an area of your app and save it directly to .GIF, for example by using LICEcap, so that we can see what's happening ? Quote Link to comment Share on other sites More sharing options...
mos Posted April 13, 2018 Author Share Posted April 13, 2018 Hi Delphi Developer, Another question. I need to center an image in a stringgrid cell and based on what I have seen I need to set the following in the DIV: style="text-align:center" I added the following to the CustomCSS in the ServerModule: .supergrid .x-grid-cell-inner { text-align: center } What do I need to do to apply the above CSS to the DIV? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 13, 2018 Share Posted April 13, 2018 Perhaps you should have to move to "ExtJS 6.5", What do you think?! Quote Link to comment Share on other sites More sharing options...
mos Posted April 13, 2018 Author Share Posted April 13, 2018 Hi Delphi Developer, Would moving to ExtJS 6.5 allow me to use the CSS above? Is there a reason why it can't be done in ExtJS 4? Quote Link to comment Share on other sites More sharing options...
mos Posted April 13, 2018 Author Share Posted April 13, 2018 And please, can you capture an area of your app and save it directly to .GIF, for example by using LICEcap, so that we can see what's happening ? In the attachment provided the row select bar is blue and the yellow first two columns are where the JS code was applied. In this example you can see that the blue bar does not cover the yellow cells when the row is highlighted. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 13, 2018 Share Posted April 13, 2018 Also you can try together with this approach: http://forums.unigui.com/index.php?/topic/9220-tunistringgrid-highlight-row-and-column-on-cell-focus/&do=findComment&comment=47751 Quote Link to comment Share on other sites More sharing options...
mos Posted April 15, 2018 Author Share Posted April 15, 2018 Hi Delphi Developer, Is there update on this as I need to be able to center an image in a cell? Hi Delphi Developer, Another question. I need to center an image in a stringgrid cell and based on what I have seen I need to set the following in the DIV: style="text-align:center" I added the following to the CustomCSS in the ServerModule: .supergrid .x-grid-cell-inner { text-align: center } What do I need to do to apply the above CSS to the DIV? Quote Link to comment Share on other sites More sharing options...
mos Posted April 26, 2018 Author Share Posted April 26, 2018 Hi Delphi Developer, Is it possible to remove the cell focus highlight so that no cell is highlighted in the stringgrid? is it possible to set the background color of the column titles row when ShowColumnTitles is True? Also is it possible to trap the click event on column title cells and then be able to call some other Delphi code? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 26, 2018 Share Posted April 26, 2018 Hi, Is it possible to remove the cell focus highlight so that no cell is highlighted in the stringgrid? And it doesn't matter which cell is selected ? Quote Link to comment Share on other sites More sharing options...
mos Posted April 26, 2018 Author Share Posted April 26, 2018 Hi Delphi Developer Hi, And it doesn't matter which cell is selected ? I don't want the cell selection to be visible on any cell in the grid. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 27, 2018 Share Posted April 27, 2018 Hi, ReadOnly = True ? Quote Link to comment Share on other sites More sharing options...
mos Posted April 27, 2018 Author Share Posted April 27, 2018 Hi Delphi Developer, Hi,ReadOnly = True ? I had already tried setting the Enabled to False but it grays out the grid. I want the grid to appear normally without any cell focus highlighted. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 27, 2018 Share Posted April 27, 2018 Hi, I had already tried setting the Enabled to False but it grays out the grid. Yes I know, I meant that your grid is not editable.. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 27, 2018 Share Posted April 27, 2018 I don't want the cell selection to be visible on any cell in the grid. Try this: function beforeInit(sender, config) { config.disableSelection=true; } Quote Link to comment Share on other sites More sharing options...
mos Posted May 3, 2018 Author Share Posted May 3, 2018 Hi Delphi Developer, If I have goRangeSelect enabled in VCL StringGrid we can normally use the Selection property to find out what cells are selected. Is there a way of doing this in UniStringGrid as I noticed there is a goRangeSelect but no Selection property? Quote Link to comment Share on other sites More sharing options...
Kast2k Posted June 5, 2018 Share Posted June 5, 2018 Hi! There is CSS problem with TUniStringGrid in 6.5.3 Later i was using this CSS for fitting all table cells on panel .SGGL .x-grid-table { height: 100%; width: 100%; } .SGGL .x-grid-cell-Inner { text-align: center !important; } .SGGL .x-grid-cell { vertical-align : middle !important; } function beforeInit(sender, config) { config.cls = "SGGL"; } After update to 6.5.3 this CSS is not full workable. I tried different x-grid and panels parameters for repair, but no results Could you please help me to correct this CSS? Or may be somebody had the same trouble with new ExtJS. Thank You! I attached 2 pictures: normal situation and after 6.5.3. 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.