You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

  • "indyglassman" started this thread

Posts: 10

Date of registration: May 9th 2014

  • Send private message

1

Friday, May 9th 2014, 5:06pm

Jbgrid Issue

I'm working with the Jbgrid. I populate the grid, set the column headers and column widths. I'm also using the Jbgrid.celleditor.component feature for both the checkbox and combolist.

The problem is: If I select a field in column 3, Beforecelledit and sets the celleditor.component to a jbcombobox. If I click to edit a cell in column 3 and do not change the value, then click on another cell, the column widths all change. If I change the value in the column and then select another cell, the column widths do not change. Is this a bug?

** UPDATE: For what it is worth. I found sample code from Dani (in URL below) and loaded it. I can duplicate the problem with that sample. To see the problem load the sample code. Run the code and note the column widths. Then click on any cell in "Header 1" column. DO NOT select a new value. Then click on any other cell. When you do -- watch how the column widths change. In this example the shift in column widths is most notable if you watch the "gap" between the last row and the scroll bar as you click in row "Header 1" and then back to any cell.

How to set column widths in JbGrid?

Source code

1
2
3
4
5
6
7
Select Case col
  	Case 3
     	JBGrid.CellEditor.Component = JBComboBox
     	JBGrid.CellEditor.JBComboBox.ComboList = "Stock|Super Stock|Masters"
  	Case 4   'Active True/False
     	JBGrid.CellEditor.Component = JBCheckBox
 	End Select

This post has been edited 1 times, last edit by "indyglassman" (May 9th 2014, 5:45pm) with the following reason: Additional info


  • "indyglassman" started this thread

Posts: 10

Date of registration: May 9th 2014

  • Send private message

2

Friday, May 9th 2014, 6:39pm

I thought I had figured a work around but I was wrong.

Adding the code to set column widths in the LostFocus() event helps some, but not 100%

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

3

Saturday, May 10th 2014, 12:34am

Hey there,

I have just downloaded my own sample code and played around with it as you proposed.
But I can not relate to what you observed!

The JBGrid behaves as expected on my systems (Win 7/8, Mac OS)!

What OS are you on?
What framework version are you using?
Are you running my sample as is or did you change any properties of the grid?

Sorry, but since I can not provoke this false behaviour it is hard for me to be of any help!


Dani

  • "indyglassman" started this thread

Posts: 10

Date of registration: May 9th 2014

  • Send private message

4

Saturday, May 10th 2014, 4:24am

Dani

Thank you for looking into this.

I've tried this on a couple different systems to ensure it wasn't something just on my laptop. So far I've tested it with the same result on:
Windows 7 Enterprise
Windows 7 Professional, SP1

Yes, I ran the sample exactly as the ZIP file that I mentioned with one exception. The following line:
JBGrid1.CellEditor.JBComboBox.Style = jbDropdownList
which is in JBGrid1_BeforeCellEdit (In your sample program) Doesn't like the Style and says "Function or variable not defined. So I commented that line out.

I updated the framework based on your post here:
How to Get The Latest Jabaco Framework?

I have Rev 127 dated 12/8/13 from https://code.google.com/p/jbaindi/downlo…27.zip&can=2&q=

** To "update" all I did was to unzip this file and overwrite what I have installed. So the jabaco.jar, jabaco.xml and lang directory. If that isn't what I need to do to update the latest framework, could you please point me to how I do that??



Here is a video so you can see what I am seeing:
http://youtu.be/5GArFg_7CRA
1. First, I show the one line I had to comment out from your sample code.

2. Then, I run the code and you see the JBGrid control populated

3. Then, I click on the column and the comboBox shows in the cell.

4. I then click on the cell again, with out changing the value.

5. Look at the width of the columns....then I click on another cell and you see that the column width changes. This is most notable by seeing the gap between the last column and the scroll bar.

Hope that helps

This post has been edited 3 times, last edit by "indyglassman" (May 10th 2014, 4:51am)


Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

5

Saturday, May 10th 2014, 8:20am

Hey there,

great demonstration...

You can find the latest framework revision here:

http://www.jabaco.org/wiki/Latest_JabacoFramework_Binary

please extract the Jabaco.jar to your jabaco path.

But I don't think anything changed concerning the JBGrid since version 127.

OK, so the grid is loosing our predefined width for column3 after opening and closing a combobox in column1 and then clicking on another cell in column1 !

Try playing around with JBGrid1.AutoResize values. Define them in code in the Form_Load Sub.
Try setting the ColWidth in even another place:

Jabaco Source

1
2
3
4
Public Sub JBGrid1_AfterCellEdit(row As Integer, col As Integer)
   JBGrid1.ColWidth(3) = 100
   Text1.AppendText "HitTest: AfterCellEdit " & JBGrid1.Row & "/" & JBGrid1.Col & vbCrLf
End Sub


I will look at the framework again but as I have said, since I can not reproduce this behaviour it is pretty hard for me solve this.


Dani

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

6

Saturday, May 10th 2014, 8:26am

Just try the latest framework I think you should be fine then...

;)

  • "indyglassman" started this thread

Posts: 10

Date of registration: May 9th 2014

  • Send private message

7

Saturday, May 10th 2014, 12:39pm

Thank you, Dani.

Updating from 127 to 135 did fix the problem. I have saved the correct link to the latest binaries so I can keep up-to-date.

I appreciate your help.

Rate this thread
WoltLab Burning Board