allenchow Posted June 7, 2018 Posted June 7, 2018 1. When I use DrawColumnCell to change a row color for particular condition, the default color for selection won't show anymore for those rows when selecting. (It won't like that before using ver 6 js) 2. How to change all grid border color to black for all dbgrid without using theme ? Thanks! Quote
Sherzod Posted June 7, 2018 Posted June 7, 2018 Hello, Can you make a simple testcase for this, for a better view?! Quote
allenchow Posted June 7, 2018 Author Posted June 7, 2018 1. See attachment 2. Yup , for better view Project3.zip Quote
Sherzod Posted June 7, 2018 Posted June 7, 2018 Ok Maybe you wanted like this?: CustomCSS: .x-grid-item-over .x-grid-cell-inner { color:#000; background-color: yellowgreen; } Quote
allenchow Posted June 8, 2018 Author Posted June 8, 2018 No. Actually I need all border lines with darker color instead of light-gray How's the solution for #1 ? Thanks ! Quote
allenchow Posted June 8, 2018 Author Posted June 8, 2018 Also, I've mentioned before that there are spaces below each rows inside dbgrid I've attached the test case Thanks ! Project3.zip Quote
Sherzod Posted June 8, 2018 Posted June 8, 2018 Hi, Sorry, сan you make an "image" indicating the problem and how it should be?.. Quote
allenchow Posted June 8, 2018 Author Posted June 8, 2018 For Question # 1, When I select a row, it should show blue in background color , no matter it's in pink or in white originally (in extjs 4.X before) Quote
Sherzod Posted June 11, 2018 Posted June 11, 2018 Hi, I'm sorry, I don't really understand your request Quote
allenchow Posted June 13, 2018 Author Posted June 13, 2018 See Attachment How about the problem in #8 above ? Quote
allenchow Posted June 14, 2018 Author Posted June 14, 2018 Did you try the sample test project ? When you scroll down to the bottom of the grid, there're a lot of empty space ! Quote
allenchow Posted June 14, 2018 Author Posted June 14, 2018 try next page and next page, or forward and backward several times, you may see the result that I show. Quote
allenchow Posted June 14, 2018 Author Posted June 14, 2018 Your column width is not the same as mine. Just keep the original width Quote
Sherzod Posted June 14, 2018 Posted June 14, 2018 Your column width is not the same as mine. Just keep the original width Also, I've mentioned before that there are spaces below each rows inside dbgrid I've attached the test case Thanks ! I did not change anything Quote
allenchow Posted June 14, 2018 Author Posted June 14, 2018 I've found a very weird thing : Just unzip to a folder and open the project, (DONT'S OPEN the MAIN.PAS FILE) , compile and run ! You will see the difference. Once you open the main.pas file, it will be normal again .......... Don't know why ! Quote
allenchow Posted June 14, 2018 Author Posted June 14, 2018 Also when you open main.dfm with notepad, you'll see the column of company is 64 : item FieldName = 'Company' Title.Caption = 'Company' Width = 64 end item But when open inside Delphi , it changes to 184 automatically Quote
Sherzod Posted June 14, 2018 Posted June 14, 2018 Also when you open main.dfm with notepad, you'll see the column of company is 64 : item FieldName = 'Company' Title.Caption = 'Company' Width = 64 end item But when open inside Delphi , it changes to 184 automatically TColumn has a method named DefaultWidth (64), which is called in particular when the width hasn't been explicitly assigned to the column (which is true for the dynamically created grid columns). Basically, it takes the column's associated field's display width (in chars) and multiplies it by the width of the 0 character (in pixels), using the corresponding font. It then compares the result to the width of the title (in pixels) and returns the greater value. https://stackoverflow.com/questions/5446520/how-does-a-dbgrid-component-determine-initial-column-widths-to-display Quote
allenchow Posted June 14, 2018 Author Posted June 14, 2018 Did you try the method that I mentioned in #20 ? Quote
allenchow Posted June 14, 2018 Author Posted June 14, 2018 Maybe try this one, you will see spaces in page 1 or page 2 Project1.zip Quote
allenchow Posted June 14, 2018 Author Posted June 14, 2018 TColumn has a method named DefaultWidth (64), which is called in particular when the width hasn't been explicitly assigned to the column (which is true for the dynamically created grid columns). Basically, it takes the column's associated field's display width (in chars) and multiplies it by the width of the 0 character (in pixels), using the corresponding font. It then compares the result to the width of the title (in pixels) and returns the greater value. https://stackoverflow.com/questions/5446520/how-does-a-dbgrid-component-determine-initial-column-widths-to-display Thanks, in that case, I can't set width 64 ! Otherwise it will change to other width. I change to width 65 now . Try project 1 above Quote
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.