Jump to content
uniGUI Discussion Forums
Sign in to follow this  
allenchow

dbgrid color problem

Recommended Posts

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!

Share this post


Link to post
Share on other sites

Hello,

 

Can you make a simple testcase for this, for a better view?!

Share this post


Link to post
Share on other sites

Ok

 

Maybe you wanted like this?:

 

CustomCSS:

.x-grid-item-over .x-grid-cell-inner  {
    color:#000;
    background-color: yellowgreen;
}

Share this post


Link to post
Share on other sites

No. Actually I need all border lines with darker color instead of light-gray

How's the solution for #1 ? 

Thanks !

Share this post


Link to post
Share on other sites

Also, I've mentioned before that there are spaces below each rows inside dbgrid

I've attached the test case

Thanks !

Project3.zip

Share this post


Link to post
Share on other sites

Hi,

 

Sorry, сan you make an "image" indicating the problem and how it should be?..

Share this post


Link to post
Share on other sites

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) 

Share this post


Link to post
Share on other sites

Hi,

 

I'm sorry, I don't really understand your request

Share this post


Link to post
Share on other sites

Did you try the sample test project  ?

When you scroll down to the bottom of the grid, there're a lot of empty space !

Share this post


Link to post
Share on other sites

try next page and next page, or forward and backward several times, you may see the result that I show.

Share this post


Link to post
Share on other sites

Your column width is not the same as mine. Just keep the original width

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 !

Share this post


Link to post
Share on other sites

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 

Share this post


Link to post
Share on other sites

 

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

Share this post


Link to post
Share on other sites

 

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×