|
-
Dec 22nd, 2021, 08:41 AM
#721
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I noticed a bug for 'FlexAlignmentGeneral'.
Currently it right aligns for numbers and left aligns for text.
However, it should right align for numbers and dates !
It's embarrassing that it could withstand since initial release.. so now it is fixed.
Generic sorting will still sort only numbers and strings. (no dates; like in MS(H)FlexGrid)
So keep using FlexSortDateAscending/FlexSortDateDescending for dates.
Last edited by Krool; Dec 22nd, 2021 at 09:37 AM.
-
Dec 22nd, 2021, 01:59 PM
#722
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
I noticed a bug...
Found an additional one in 1.5.1, I think - not showing a HScrollbar, when .Cols < 3
e.g. with Cols = 2 ... and ColWidth(1) via code set larger than the Grid-Width -
(generally, not only when working in IVBFlexDataSource-Mode).
Olaf
-
Dec 22nd, 2021, 04:50 PM
#723
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Schmidt
Found an additional one in 1.5.1, I think - not showing a HScrollbar, when .Cols < 3
e.g. with Cols = 2 ... and ColWidth(1) via code set larger than the Grid-Width -
(generally, not only when working in IVBFlexDataSource-Mode).
Olaf
How is FixedCols set?
-
Dec 22nd, 2021, 04:52 PM
#724
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
How is FixedCols set?
The Fixed-Props are at their defaults: 1
Olaf
-
Dec 22nd, 2021, 04:53 PM
#725
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Schmidt
The Fixed-Props are at their defaults: 1
Olaf
Ok then it's by design to have no H-Scrollbar since there is only 1 scrollable col, which extends beyond client rect. It simply can't scroll..
-
Dec 22nd, 2021, 05:01 PM
#726
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Ok then it's by design to have no H-Scrollbar since there is only 1 scrollable col, which extends beyond client rect. It simply can't scroll..
Right, sorry for the noise...
(forgot, that the Flex does not support Pixel-based HScrolling, but scrolls "integral, whole Cols" instead)
Olaf
-
Dec 26th, 2021, 08:32 PM
#727
Junior Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi,
(Newbie here !!)
I notice a change in behaviour with msflexgrid, this code was written 30 years ago by someone else for the old grid32. I converted it to msflexgrid, but since the redraw screen on win10 on some occasion was flashy and long, I decided to test this version.
In the previous control, a fix column will obey the Grid1.ColAlignment(0) = 4 (FlexAlignmentCenterCenter) , but with the current it's not, I remove the fix column = 1 argument and it works.
Maybe there's another function to call to align a fix column? but the way I see it, it's not a direct replacement then !
Thanks
-
Dec 27th, 2021, 01:21 AM
#728
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by jffortier
Hi,
(Newbie here !!)
I notice a change in behaviour with msflexgrid, this code was written 30 years ago by someone else for the old grid32. I converted it to msflexgrid, but since the redraw screen on win10 on some occasion was flashy and long, I decided to test this version.
In the previous control, a fix column will obey the Grid1.ColAlignment(0) = 4 (FlexAlignmentCenterCenter) , but with the current it's not, I remove the fix column = 1 argument and it works.
Maybe there's another function to call to align a fix column? but the way I see it, it's not a direct replacement then !
Thanks
There is ColAlignment and FixedAlignment.
ColAlignment overwrites the FixedAlignment when FixedAlignment is not explicitly set.
Can you share the code so I can replicate the potential issue?
Thanks
-
Jan 2nd, 2022, 12:28 PM
#729
Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
First of all, wish you a great new year.
Ask him about drag and drop between columns, outside and inside a vbgrid to another vbgrid (grid1 to grid2) and about the merged cell, to be able to build a kanban. Thanks a lot
-
Jan 10th, 2022, 12:30 AM
#730
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hello Krool,
I'm testing the VBFlexGrid, I'm doing it with the ocx version (latest, 1.5), and I found that when there are no rows, the AddItem method raises an error.
To test it, with a new added VBFlexGrid control to a form, this is the code:
Code:
Private Sub Form_Load()
VBFlexGrid1.FixedRows = 0
VBFlexGrid1.Rows = 0
End Sub
Private Sub Command1_Click()
VBFlexGrid1.AddItem "AA" & vbTab & "BB"
VBFlexGrid1.Refresh
End Sub
The same code works with the MSHFlexGrid without raising an error.
Also, I noticed that if I don't add the VBFlexGrid1.Refresh, the grid is not visually updated until I click on it, unlike the MSHFlexGrid.
I don't know whether these differences are on purpose or a bug.
Thanks.
-
Jan 10th, 2022, 08:08 AM
#731
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Eduardo-
Hello Krool,
I'm testing the VBFlexGrid, I'm doing it with the ocx version (latest, 1.5), and I found that when there are no rows, the AddItem method raises an error.
To test it, with a new added VBFlexGrid control to a form, this is the code:
Code:
Private Sub Form_Load()
VBFlexGrid1.FixedRows = 0
VBFlexGrid1.Rows = 0
End Sub
Private Sub Command1_Click()
VBFlexGrid1.AddItem "AA" & vbTab & "BB"
VBFlexGrid1.Refresh
End Sub
The same code works with the MSHFlexGrid without raising an error.
Also, I noticed that if I don't add the VBFlexGrid1.Refresh, the grid is not visually updated until I click on it, unlike the MSHFlexGrid.
I don't know whether these differences are on purpose or a bug.
Thanks.
Good catch. That's a bug. Fixed now.
Thanks
-
Jan 16th, 2022, 05:07 AM
#732
Banned
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi Krool,
I don't know how to make a allowed formated input,for example, allow a float number with "+" or "-" or a scientific ... can I?
Thanks in advance.
-
Jan 16th, 2022, 05:09 AM
#733
Banned
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi Krool,
How to make a formated input , such as add a float number with "+", or "-", or a scientific ...
Thanks.
-
Jan 23rd, 2022, 10:22 PM
#734
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
hi,i have a simple form with adodc control and this gird
i want set datasource of this gird to adodc1 and then
how can add new record synced with grid or delete or refresh or edit used by grid
i did not find any sample about example use access data with this girl in download folder.
any body can send a simple project to can work with access binded to gird here ?
Last edited by Black_Storm; Jan 23rd, 2022 at 11:26 PM.
-
Jan 27th, 2022, 05:09 AM
#735
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Black_Storm
...how can add new record synced with grid or delete or refresh or edit used by grid
The Grid supports an IVBFlexDataSource interface for such Binding-scenarios.
This interface operates only on "simple string-types" (not specific Recordset-Types).
So, you can bind not only Recordsets, but also "any 2D-Array" or "JSON-Collection" or whatever.
A small example-implementation (which does a binding to SQLite-Recordsets) can be studied here:
https://www.vbforums.com/showthread....te-Recordsets)
Olaf
-
Jan 27th, 2022, 06:44 PM
#736
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
why datasource property designed in this grid control but i should be use like as ur class and use IVBFlexDataSource ?!!
if this property designed for bind to any data control so how can use it ? any sample?
do u have any simple sample to i jst set this property to a adodc1?
i did see your topic before i ask my question here but i don't want fill my grid with coding and run query for each update or delete and like these actions,i want use like as data grid and binded automatically to adodc1
for example can i set this grid.DataSource = adodc1 in design and then just work with adodc1 like as adodc1.recordset.addnew or update or refresh or movefirtst move last and etc automatically binded to gird ?and i did not see retrieve field on rightclick on grid or change captions or fields binded and like these options...
so i think i can use bind between this grid and adodc or ... just with coding and do I have to do this for anything I need? .
if u know any datagrid (not like as vhflexgrid) to support cool theme (skins) and righttoleft layout?
i dont know yet maybe this grid support change skin or theme with coding if possible any sample code?
i found some but they have problem with righttoleft layout (like as jgrid or something better than jgrid) or trials...
-
Jan 28th, 2022, 12:59 AM
#737
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Black_Storm
why datasource property designed in this grid control but i should be use like as ur class and use IVBFlexDataSource ?!!
if this property designed for bind to any data control so how can use it ? any sample?
do u have any simple sample to i jst set this property to a adodc1?
i did see your topic before i ask my question here but i don't want fill my grid with coding and run query for each update or delete and like these actions,i want use like as data grid and binded automatically to adodc1
for example can i set this grid.DataSource = adodc1 in design and then just work with adodc1 like as adodc1.recordset.addnew or update or refresh or movefirtst move last and etc automatically binded to gird ?and i did not see retrieve field on rightclick on grid or change captions or fields binded and like these options...
so i think i can use bind between this grid and adodc or ... just with coding and do I have to do this for anything I need? .
if u know any datagrid (not like as vhflexgrid) to support cool theme (skins) and righttoleft layout?
i dont know yet maybe this grid support change skin or theme with coding if possible any sample code?
i found some but they have problem with righttoleft layout (like as jgrid or something better than jgrid) or trials...
The .DataSource property is not binding for CRUD.
It's just reading a recordset and filling the grid.
-
Feb 8th, 2022, 08:56 AM
#738
Junior Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Krool,
Several 'Pages' ago in the thread, you spoke about altering the ClipMode options, so that Fixed Cols/Rows could be included/excluded as required. Is this something still on the cards.
Am looking at migrating my system to use the new grid, and am slowly updating my 'helper' functions to work with the new grid. Now looking at my function to send the whole grid to excel. I'm hoping this will be a lot neater using the Clip function, but I would like the header to be copied across. I can do this in code, but if the ClipMode alterations are still on the to-do list that would make it easier/neater
Thanks
Lee.
-
Feb 27th, 2022, 03:28 PM
#739
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Krool,
when I fill the VBFlexGrid from database the records are displayed fine.
but when I fill by code it is showing strange symbols.
I'm using Arabic Egypt in regional setting.
Is there a workaround?
-
Feb 28th, 2022, 02:15 AM
#740
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Mustaphi
Krool,
when I fill the VBFlexGrid from database the records are displayed fine.
but when I fill by code it is showing strange symbols.
I'm using Arabic Egypt in regional setting.
Is there a workaround?
Use a different font. E.g. Microsoft Sans Serif instead of MS Sans Serif.
-
Feb 28th, 2022, 11:31 AM
#741
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Use a different font. E.g. Microsoft Sans Serif instead of MS Sans Serif.
thanks but it didn'thelp
still strange symbols
-
Feb 28th, 2022, 11:39 AM
#742
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Mustaphi
Krool,
when I fill the VBFlexGrid from database the records are displayed fine.
but when I fill by code it is showing strange symbols.
I'm using Arabic Egypt in regional setting.
Is there a workaround?
How do you obtain the information to be put in the vbFlexGrid?
-
Feb 28th, 2022, 12:23 PM
#743
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Arnoutdv
How do you obtain the information to be put in the vbFlexGrid?
With VBFlexGrid1
.AddItem ""
.TextMatrix(1, 1) = "test data"
.TextMatrix(1, 2) = "test data"
End With
-
Feb 28th, 2022, 12:35 PM
#744
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
That's just hardcoded plain ASCII text.
How do you obtain your Arabic texts?
From a text file? From user input?
-
Feb 28th, 2022, 01:18 PM
#745
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Arnoutdv
That's just hardcoded plain ASCII text.
How do you obtain your Arabic texts?
From a text file? From user input?
in fact I'm binding the grid to database
Code:
Set .FlexDataSource = DataSource.BindTo(Rs)
I just need to hardcode the columnheders.
Code:
.TextMatrix(0, 1) = "الرقم"
.TextMatrix(0, 2) = "التاريخ"
.TextMatrix(0, 3) = "الاسم"
thanks
-
Feb 28th, 2022, 02:31 PM
#746
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Mustaphi
in fact I'm binding the grid to database
Code:
Set .FlexDataSource = DataSource.BindTo(Rs)
I just need to hardcode the columnheders.
Code:
.TextMatrix(0, 1) = "الرقم"
.TextMatrix(0, 2) = "التاريخ"
.TextMatrix(0, 3) = "الاسم"
thanks
Maybe your PC (non-unicode language settings) is in Arabic, thus DBCS mode is on. That's why you can place "fake" unicode in the VB6 IDE but in fact in other language (non-DBCS mode) will fail .
It's just a guess out of the blue..
-
Mar 6th, 2022, 05:27 PM
#747
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
hi krool
I'm using this code to send data from VBFlexGrid to excel.
The vb6 FlexGrid is showing Arabic quite normal in theexcel sheet but VBFlexGrid is showing strange symbols.
Code:
Private Sub FlexToExcel()
Dim xlObject As Excel.Application
Dim xlWB As Excel.Workbook
Set xlObject = New Excel.Application
'This Adds a new woorkbook, you could open the workbook from file also
Set xlWB = xlObject.Workbooks.Add
Clipboard.Clear 'Clear the Clipboard
With MSFlexGrid1
'Select Full Contents (You could also select partial content)
.Col = 1 'From first column
.Row = 0 'From first Row (header)
'.ColSel = .Cols - 1 'Select all columns
.RowSel = .Rows - 1 'Select all rows
Clipboard.SetText .Clip 'Send to Clipboard
End With
With xlObject.ActiveWorkbook.ActiveSheet
.Cells(1, 1)Select 'Select Cell A1 (will paste from here, to different cells)
.Paste 'Paste clipboard contents
.Columns(1).Font.Bold = True
.Columns(1).HorizontalAlignment = xCenter
End With
'-------------------------------------------------
Clipboard.Clear 'Clear the Clipboard
With MSFlexGrid1
'Select Full Contents (You could also select partial content)
.Col = 4 'From first column
.Row = 0 'From first Row (header)
'.ColSel = .Cols - 1 'Select all columns
.RowSel = .Rows - 1 'Select all rows
Clipboard.SetText .Clip 'Send to Clipboard
End With
With xlObject.ActiveWorkbook.ActiveSheet
.Cells(1, 2)Select 'Select Cell A1 (will paste from here, to different cells)
.Paste 'Paste clipboard contents
.Columns(2).Font.Bold = True
.Columns(2).HorizontalAlignment = xCenter
End With
' This makes Excel visible
xlObject.Visible = True
End Sub
-
Mar 7th, 2022, 05:03 PM
#748
Fanatic Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
I noticed that if the input /keyboard language is Arabic everything is OK.
But if the the input language is english, it shows as weird characters in excel sheet.
I'm referring to the Keyboad language (the one in the right bottom of the screen) not in regional settings.
Last edited by Mustaphi; Mar 7th, 2022 at 05:28 PM.
-
Mar 12th, 2022, 11:04 AM
#749
Hyperactive Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi,
I'm using MouseRow to detect the row the user is clicking on. With the left mouse click, this returns the correct row. However, if I right mouse click on a row, MouseRow returns the currently selected row. For example: I have a grid with the first row fixed as column headers, and 4 rows with data below that. The last row is selected, i.e. MouseRow returns 4. If I right mouse click on another row, MouseRow will always return 4, while a left mouse click would return the correct rownumber.
Am I doing something wrong, or am I missing something?
Thanks,
Erwin
[Edit] Additional info
I have a VBFlexGrid called grdFixtureList with a fixed header row, and several rows of data. The below code creates a popup menu depending on where the user clickied. A strange thing happens if I place a breakpoint on the line "If .Row < .RowSel Then". I right mouse clicked on another row than the one that was selected. Now, if I move the mouse cursor over the first instance of .MouseRow above the comment User clicked selected area) the labeltip give me another value than when I place the mouse over the last instance of .MouseRow below the comment User clicked a new row.
One property having two different values at the same time? Something strange is happening.
Code:
Private Sub grdFixtureList_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim iStartRow As Integer
Dim iEndRow As Integer
Dim iSelectedPopUpMenuItem As Integer
If (Button = vbRightButton) And (grdFixtureList.Rows > 1) Then
'Select the row the user clicked on
With grdFixtureList
'If the user clicked on one or more selected Fixtures, pop up the menu, otherwise select the row
If .Row < .RowSel Then
iStartRow = .Row
iEndRow = .RowSel
Else
iStartRow = .RowSel
iEndRow = .Row
End If
If (.MouseRow >= iStartRow) And (.MouseRow <= iEndRow) Then
'User clicked selected area
If iStartRow = iEndRow Then
'Only one item selected, show/hide appropriate menu-items
iSelectedPopUpMenuItem = CreateMenuPopUpFixtureList(LIST_POPUP_MENU_SINGLE_ITEM)
Else
'Multiple items selected, show/hide appropriate menu-items
iSelectedPopUpMenuItem = CreateMenuPopUpFixtureList(LIST_POPUP_MENU_MULTIPLE_ITEMS)
End If
Else
'User clicked a new row. Simulate a click to have the item selected in the floorplan and then show the menu
.Row = .MouseRow
Call grdFixtureList_Click
iSelectedPopUpMenuItem = CreateMenuPopUpFixtureList(LIST_POPUP_MENU_SINGLE_ITEM)
End If
End With
'Process the selected menuitem
Select Case iSelectedPopUpMenuItem
Case 0
'User didn't select any menu
Case 1
Call mnuPopUpChangeFixture_Click
Case 2
Call mnuPopUpDuplicateFixture_Click
Case 3
Call mnuPopUpRemoveFixture_Click
Case 4
Call mnuPopUpRemoveFixture_Click
End Select
End If
End Sub
Last edited by Erwin69; Mar 12th, 2022 at 12:16 PM.
-
Mar 22nd, 2022, 04:56 PM
#750
Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
There is a problem in Win10 with the DPI, other than that how would I send a regular size file? I have vbflexgrid with some more features, but it is impossible for me to upload to the server
-
Mar 23rd, 2022, 08:58 PM
#751
Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Excuse me group, will there be a group like Whatsapp or Telegram?
-
Apr 10th, 2022, 07:43 PM
#752
Junior Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Add a Row use "Additem". I want to Add a Col.What I use?
-
Apr 11th, 2022, 12:06 AM
#753
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by fengzhongxia
Add a Row use "Additem". I want to Add a Col.What I use?
Code:
VSFlexGrid1.Cols = number_of_columns_that_you_want
-
May 6th, 2022, 04:33 AM
#754
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi Krool,
I'm thinking about a question, can we develop a VBFlex-like control without subclassing and VTable? In other words, what features/functions in the subclass cannot be replaced by other technologies?
-
May 12th, 2022, 01:01 PM
#755
New Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hi: Krool
please visit url: https://github.com/lizanodiaz/vbflexgrid
there are many improvements that you can implement in your vbflexgrid, like progress bars, toggle button, etc. The purpose is to have a good, more powerful and functional grid (note the original grid has some DPI problems in windows 10).
-
May 30th, 2022, 04:54 AM
#756
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Small update release.
Setting .FlexDataSource to nothing will invalidate the grid now and does not cause an immediate redraw anymore.
I got a scenario where that forced complete redraw is annyoing. So having just the invalidation is fine.
If somebody want's to continue to have an immediate redraw, one can do so by a following .Refresh code line.
-
Jun 8th, 2022, 02:17 AM
#757
Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hello, Krool.
The colPosition() and rowPosition() properties should move the column resp. row not swap them.
Is this by design? If so, could you implement the 'original' behavior to the VBFlexgrid?
Thanks
-
Jun 8th, 2022, 02:44 AM
#758
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Seniorchef
Hello, Krool.
The colPosition() and rowPosition() properties should move the column resp. row not swap them.
Is this by design? If so, could you implement the 'original' behavior to the VBFlexgrid?
Thanks
There is the RowPos() and RowPosition() properties (and Col resp.) and they already behave like in msFlexGrid.
-
Jun 8th, 2022, 03:09 AM
#759
Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Hello!
No, the don't.
The colPosition() in VBFl,exGrid swaps two columns:
colPosition(6)=10 in VBFlexGrid results in columns 5,10,7,8,9,6,11 ...
colPosition(6)=10 in MSHFlexGrid results in columns 5,7,8,9,10,6,11...
rowPosition() behave the same.
Greetings
That is colPosition(6)=10 cols 6 and 10 get swapped, nothing else changes. MSFlexGrid moves column 6 behind column ten, so the new order is 5,7,8,9,10,6,11
-
Jun 8th, 2022, 03:10 AM
#760
Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Oops, sorry for the lines after greetings :-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|