Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Janus Grid - Tooltips For Columns


How do u set individual tooltips in a janus grid for columns??? There is a tooltip property on the grid but this is for the whole grid. I am using version 1.6.

Thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Janus GrisEx 2000 - Initialising New Row Columns
I want to be able to initialise the columns in the new record row in the Janus GridEx programmatically.

The problem is I dont think you can set the values in the GridEx outside of the GridEx's UnboundReadData subroutine yet this subroutine doesnt get called to refresh the New Row as far as I can see.

My GridEx is unbound by the way. I use a collection of objects to populate the GridEx with data.

Does anyone know how to reference the GridEx New Row (index -1) and initialise any of the columns to whatever value desired?

Janus GridEx 2000 - Initialising New Row Columns
I want to be able to initialise the columns in the new record row in the Janus GridEx programmatically.

The problem is I dont think you can set the values in the GridEx outside of the GridEx's UnboundReadData subroutine yet this subroutine doesnt get called to refresh the New Row as far as I can see.

My GridEx is unbound by the way. I use a collection of objects to populate the GridEx with data.

Does anyone know how to reference the GridEx New Row (index -1) and initialise any of the columns to whatever value desired?

Janus Grid Or Ultra Grid?
Hi,

I'm in the market to purchase the best grid that I can find. So far, I have tried both the Janus Grid 2000 from Janus Systems and the Ultra Grid 2.0 from Infragistics.

I wanted to get your feedback and opinions on the above controls and which one you would recommend. Cost is not really a concern because I need a full featured grid with no compromises. Or, any other grids you suggest...

Thanks,

dan

TreeView && Janus Grid
Hi,

I am populating my treeview and want to add the items to a janus grid. Can someone please help. Thanks.

Mark Cells In Janus Grid
I need to mark part of a column of cells in the janus grid by clicking and dragging and make them highlight in some way.  I then need to update those cells by clicking a button.

Does anyone know how to do this?  Otherwise I'll have to go back to using the standard grid and do-it-yourself editing.

Peter Meachem
peter@accuflight.com

Cell Level ToolTips Using FarPoint Spread Or Grid Controls
Does anyone know how to detect which cell the mouse is currently over, so that I can retreive information from that cell or row and display it in a tooltip. The mousemove event only returns the x and y coordinates, and this is not much help? Any help would be appreciated.

Grid With Columns?
I am trying to find a control that i can use that would let me have column headers, like Item, price, description, etc.


then I want to be able to add rows to that... I can't seem to find one! anyone?

(Like this I guess: http://www.microregister.com/shareware/mrpos.jpg ... the orange is the headers)

Thanks

Grid With Columns?
I am trying to find a control that i can use that would let me have column headers, like Item, price, description, etc.


then I want to be able to add rows to that... I can't seem to find one! anyone?

(Like this I guess: http://www.microregister.com/shareware/mrpos.jpg ... the orange is the headers)

Thanks

Grid Columns
It's become crytical for me to have a grid in my app that's able to split columns, or in other words have columns with sub-columns. I've looked ad MSHFlexGrid's hierarchy-feature and found it quite usefull for another part of my app, but not for this.

What can I use to accomplish this. Maybe a datagrid? It looked like it could work, by I don't use data enviroments and it doesn't seem like the datagrid is for unbound use.

Thanks.

Procedure For Columns In Grid
Hi ,
I have 10 procedures that arranges the columns headers of the MSHFlexgrid depending on the current data within it.
the difference between them is the number of columns that need to be change

for example :

Public Sub Dial_Column_Headers_Type2()
With FrmAssign.MSHFlexGridEquipmentSearch
.ColWidth(7) = 0
.ColWidth(8) = 0
.ColWidth(9) = 0
s$ = "<Login Name |<Last Name |<First Name |<Dial No |<Phone No |<Destination |<Comment "
.FormatString = s$
.ColWidth(0) = 1000
.ColWidth(1) = 1000
.ColWidth(2) = 1000
.ColWidth(3) = 1400
.ColWidth(4) = 800
.ColWidth(5) = 1400
.ColWidth(6) = 1600
End With
End Sub


my question is how to build some general procedure for that

i started to write something but i don't know how to deal with the variable Columns

Public Sub Arrange_Columns_Headers(flexgrid As MSHFlexGrid, Headers_Order As String )
With flexgrid
s$ = Headers_Order
.
.
.
End Sub

Number Of Columns In Grid
what function or property would give me the number of columns in my DBGrid?

thanks
gary

Grid's Columns Color
Hello Folks.... i have a problem... i m using TDbgrid8.0 . i m setting color of column with doctor's availability . i have time starting 9:00am to 5:00pm. if doctor time is 9:00am to 12pm and 2pm to 5:00pm the color of tat doctor will show in those time slots... when i set the color of those cells then it will give color of all cells in all rows. can any body tell me wat i can do....

Sumarize Columns In A Grid
How can I do to sumarize or totalize values from columns, I need to accumulate a total, but this code does not do that. Any time I click a column the total desapers and does not accumulate nothing.

Private Sub DBGrid1_AfterColUpdate(ByVal ColIndex As Integer)
Dim var1 As Currency
Dim var2 As Currency

var1 = DBGrid1.Columns(3).Value
var2 = DBGrid1.Columns(4).Value
Text5.Text = var1 + var1
Text6.Text = var2 + var2
End Sub

Thank you in advance

Sizing Of Columns In A Grid
How do you have vb automatically size a msflexgrid to the longest field in the record extracted from the database?

does anyone know?

Sorting Columns In Grid
<html><div style='background-color:'><DIV></DIV>
<P>Hi Friends,</P>
<P>I would like to sort on any one of the columns simply by clicking on the column header in Sheridian DB Grid.</P>
<P>Can anyone please let me know,</P>
<P>Thanks,</P>
<P>VKT<BR><BR><BR><BR><BR><BR></P>
<DIV></DIV></div><br clear=all><hr>Talk to Karthikeyan. Watch his stunning feats. <a href="http://g.msn.com/8HMBENIN/2731??PS=">Download images.</a> </html>

Data Grid Columns ?
Yeah I want to increase the columns of Data Grid control using with ADODC but I couldn't find any property of it to do that. I have 6 fields in my table but it only shows 2 fields so what to do now ?

Sorting Columns In Grid
Is there a grid that you can transfer columns from one place to another during run time and sort columns from ascendint to descending also during run time?

Automatically Resize Grid Columns?
Is it possibly to resize a MSHFlexGrid's columns according to how much data is in them?

[B]Flex Grid Columns At Run Time[/B]
Hi All,

Is it possible to specify the columns for flex grid at run time?
What i mean is....
I have a form which contains 2 command buttons and a flex grid control.
If command button 1 is pressed flex grid with 5 columns should be displayed.
If command button 2 is pressed flex grid with 6 colums should be displayed.

I want to do this without using 2 flex grid controls.
Is it Possible?
Please Help!

Populating A DB Grid With Columns From 2 Different Tables
Hi There,

I have been trying to protype this for a few hours and do not seem to be getting anywhere,  so could someone please help point me in the right direction.

I have a DB table that has 2 columns in it - I only wish one of these columns to be displayed in the DB grid. I also want another column in the DB grid that contains a column from another DB table. I am OK with doing this, but my problem comes when I want to make the second DB grid column a drop down list, based upon the contents of a column from a second db table.

eg.

Column1                     column2
dbtbl1.machinename          dbtbl2.fault_reasons(dropdown)

Any pointers would be most welcome


Problem: Grid Columns? What's The Best Component??
I have this problem:

I have to show in a grid information of several products.

The product A has 3 columns
The product B has 8 columns
The product C has 6 columns.

This way, there are some columns that will be empty and this is bad to the user.

I have the option to use TreeView, List but i need some help.

Tks

Adding And Removing Columns In The Grid OCX VB6
I can use Add and Remove Item to add and remove rows in the Grid OCX but how do I add or remove columns. In an ideal world I would like to load a new Grid as a part of a control Array and dimension the number of columns and rows at run time as well as later add and remove columns?

Add Columns To Data Grid At Runtime
Hello there, I'm using visual basic 6 and I'd like to know how to add columns to a datagrid at run time. Once I create this, I'd like for the user to enter info into the datagrid and insert that data into my database.

Thanks,

Trying To Remove Columns From Vbaccelerator Grid..
z = vbalgrid1.Columns
'remove columns

For X = z To 1 Step -1
vbalgrid1.RemoveColumn vbalgrid1.ColumnKey(X)
Next

Returns 'subscript out of range'. This is in a grid with no rows and 12 columns.

Can anyone help?

Thanks!

Custom Color For Database Grid Row/columns?
Hi

I dont find any option to customise foregroud/background color for individual row/columns of DataBaseGrid-OLEDB ActiveX component.

Any help?

Letting Users Define Grid Columns?
Kind of a GUI question….


I have an application that has a list of orders, using a grid. The columns of the grid vary, that is, Order Number, Order Date, Order Status, etc.

I want to be able to let each user choose what columns are in their grid and their order.

I was thinking of something like a list of available fields on the left and a sample grid on the right. Users would grab a field on the list and drag it over to the grid and plop it down. Or maybe just hit a >> button to move the field over to the grid on the right. Then they can arrange the ordering and size on the grid.

Anyone have code or a sample of something like this?

Need Help With Creating Dynamic Columns In Data Grid Please!!!
hi,
iam new to vb.net.iam working on a application where the user has the option to select the fields and datatype for the client table they want to build by checking the checkboxes for the data type and entering the field in the textbox.This information is saved in the table in MSaccess .I now would like to display this client table in the datagrid.i would have to get the fields from the table and make it the column headers in the data grid.
i have no idea how to achieve this. can someone help me with the code its very urgent please!!!!
thanks,

Print Flex Grid (with Aligned Columns)
The following prints a flex grid, but the columns are not aligned. What is the best way to have aligned columns. First column is 12 characters, second column 20 characters, third 15 characters.

Thanks!!


VB Code:
Private Sub cmdPrintIt_Click()     Dim i As Integer    On Error GoTo ErrHandler    Printer.FontBold = False    Printer.FontItalic = False    Printer.FontName = "Arial"    Printer.FontSize = 12         Printer.Print ""    For i = 0 To flxLastWorked.Rows - 1        Printer.Print flxLastWorked.TextMatrix(i, 0) _        & "  " & flxLastWorked.TextMatrix(i, 1) _        & "  " & flxLastWorked.TextMatrix(i, 2)    Next i         Printer.EndDoc Exit SubErrHandler:    Select Case Err.Number        Case 484   'No Printer found..            MsgBox "No Printer found.", vbExclamation + vbOKOnly, "Error"        Case Else  'Another Error            MsgBox "Error Number: " & Err.Number & " Description: " & Err.Description    End SelectEnd Sub

FlexGrid Columns Will Not Resize With Grid Or Form
HI,

I would like to know if the columns in a FlexGrid should follow the Grid as its sized up or down?

I can resize both the form and the FlexGrid but the columns never change their widths. It appears that I can get the height to change which may have more to do with a dynamically reduced font size as the form/FlexGrid shrinks.

The FlexGrid is dynamically created in a Form_Activate subroutine.

Please advise.
Thanks

Hiding Rows/columns In Flex Grid
We hide rows and columns in flex grids by setting the COLWIDTH or ROWHEIGHT to 0.

This has some odd display behavior. You can almost see the "hidden" rows - they make the "dividing line" between the rows less dark.

Has anyone else used a different technique for hiding rows or columns?

Text Over Multiple Columns In Flex Grid
is it possible to have a heading centered over multiple columns of a MS Flexgrid?

eg

Code:

| this is a heading |
| 2 | 4 | 5 |
| 3 | 5 | 5 |

Flex Grid Sizing And Naming Columns
I've tried resizing the flex grid with some of the code that's located in these posts but was unable to get it to work.
I've got a flex grid being loaded with a Recordset and I want the columns to automatically fit the longest text string,
no more no less....also is there a way to rename the columns at the top of the flexgrid without having to use individual labels,
so in other words,direct caption editing of the flexgrid caption per column. It automatically defaults to the Recordset
caption. I can turn it on or off or rename a whole section, but not individual columns?

Thanks all....and always.....Dreamon!!

Truegrid V7 Summing Two Columns On Bound Grid????? PLZ HELP!!!
Hi All,

I'm using Truegrid V7 and I am showing stock figures using a bound ado control. That bit is fine but I also want to have one of the columns as a sum of the other two. Does anyone have any ideas as I am well and truely stuck!

Thanx very much inadvance,

Jiggy!

Printing Word Warpped Flexi Grid Columns
I know how to print flexi grid data, but I am having problems if it is warped. After reading previous posts I wrote my own code to print the rows and columns. But it does not print warped columns properly. Example....

Grid Data:
-------------------------------------------------------------------------------
This text | Column 2 | Column 3 |
will Warp | | |
-------------------------------------------------------------------------------

I want printing to be.....

-------------------------------------------------------------------------------

This text Column 2 Column 3
will Warp

-------------------------------------------------------------------------------

But I get.....

-------------------------------------------------------------------------------

This text will Warp Column 2 Column 3

-------------------------------------------------------------------------------


My Code:


Code:
Dim Rows As Integer
Dim Cols As Integer
Dim X() As Integer
Dim Y() As Integer
Dim LastX As Integer
Dim LastY As Integer
Dim MaxWidth() As Integer
Dim MaxHeight() As Integer

Private Sub printGrid()
Dim tempWidth As Long
Dim Pages As Integer
Dim Copy As Integer
Dim pCnt As Integer

Dim Copies() As Integer

Printer.Font = grdReport.CellFontName
Printer.FontSize = grdReport.CellFontSize

With grdReport
ReDim X(.Cols)
ReDim Y(.Rows)
ReDim MaxWidth(.Cols)
ReDim MaxHeight(.Rows)

X(1) = PD.LBorder
Y(1) = PD.TBorder

For Rows = 1 To (.Rows - 1)
For Cols = 1 To (.Cols - 1)
If CInt(Printer.TextWidth(grdReport.TextMatrix(Rows, Cols))) > MaxWidth(Cols) Then MaxWidth(Cols) = CInt(Printer.TextWidth(grdReport.TextMatrix(Rows, Cols)))
If CInt(Printer.TextHeight(grdReport.TextMatrix(Rows, Cols))) > MaxHeight(Rows) Then MaxHeight(Rows) = CInt(Printer.TextHeight(grdReport.TextMatrix(Rows, Cols)))
Next Cols
Next Rows

For Cnt = 1 To (grdReport.Cols - 1)
If (tempWidth + (MaxWidth(Cnt) + PD.CellWSpacing)) > (Printer.ScaleWidth - PD.LBorder - PD.RBorder) Then
tempWidth = (MaxWidth(Cnt) + PD.CellWSpacing)
Pages = Pages + 1
Else
tempWidth = tempWidth + (MaxWidth(Cnt) + PD.CellWSpacing)
End If

Next Cnt

ReDim Copies(Pages + 1)

Pages = 0
tempWidth = 0

For Cnt = 1 To (grdReport.Cols - 1)
If (tempWidth + (MaxWidth(Cnt) + PD.CellWSpacing)) > (Printer.ScaleWidth - PD.LBorder - PD.RBorder) Then
tempWidth = (MaxWidth(Cnt) + PD.CellWSpacing)
Pages = Pages + 1
Copies(Pages) = (Cnt - Copies(Pages - 1))
Else
tempWidth = tempWidth + (MaxWidth(Cnt) + PD.CellWSpacing)
End If
Next Cnt

Copy = 0
For pCnt = 1 To Pages
Copy = Copy + Copies(pCnt)
Next pCnt

Copies(Pages + 1) = (grdReport.Cols - Copy - 1)


On Error GoTo Err

For Cnt = 0 To Pages
For Rows = 1 To (.Rows - 1)
For Cols = 1 To (Copies(Cnt + 1))

Copy = 0
For pCnt = 1 To Cnt
Copy = Copy + Copies(pCnt)
Next pCnt

If X(Cols + Copy) = 0 And (Cols + Copy) <> 0 Then
X(Cols + Copy) = LastX + PD.CellWSpacing + MaxWidth((Cols - 1) + Copy)
End If

Printer.CurrentX = X(Cols + Copy)
Printer.CurrentY = Y(Rows)
LastX = Printer.CurrentX
LastY = Printer.CurrentY

Printer.Print grdReport.TextMatrix(Rows, (Cols + Copy))
Next Cols
Y(Rows + 1) = Y(Rows) + MaxHeight(Rows) + PD.CellHSpacing
If (Y(Rows + 1) + MaxHeight(Rows)) > Printer.ScaleHeight Then
Y(Rows + 1) = PD.TBorder
Printer.NewPage
End If
Next Rows
Debug.Assert False
If Cnt = Pages Then Exit For
X(Cols + Copy) = PD.LBorder
Y(0) = PD.TBorder
LastX = 0
LastY = 0
Printer.NewPage
Next Cnt

End With
Printer.EndDoc
Exit Sub
Err:
If Err.Number = 482 Then MsgBox "There was a Printer Error in printing the Data", vbOKOnly + vbExclamation, "Printer Error"
End Sub


-------------------------------------------------------------------------------

There might be some flaws in the code due to my experience level. (I know 1 place). Any way I would appreciate if you help me.
The MSH Flexi Grid Control is name 'grdReport' and Command Button as 'cmdReport'

MS Flex Grid - Displaying ???? In Text Columns On Win98
All,

I developed an app on Win2000 using a MS Flex Grid.
The grid does not work properly on Win98 machines.

Is there are quick fix for this?

thanks in advance.
Scott

Scott Keith
Software Engineer
UPS Freight Services
972-304-3171

Can Drop Down In MSFlex Grid 7.0 Have Two Columns With Fixed Header
I want to have Fixed Header on combo box of VS Flex Grid 7.0. I have done the work for having a combo box with two columns in a cell on VS Flex Grid. But I am still unable have two Fixed Header for those combo box columns. Please help me in this regard.

How To Swap Data Grid Columns At Run Time (Problem Solved - Thanks... Ian)
Please let me know if there is a way to swap grid columns at run time. If not, is there any other control in vb to do the work?

User should be able to drag a column and drop it to some other position, e.g.: if column 1 is dragged and dropped at column 4, columns 2, 3, 4 should get shifted to left.

I am using VB 6.0 with mySQL as the back end.

Please help me... This is urgent.

Thanks & regards,

Pradeepika.




Edited by - pradeepika on 7/1/2005 10:33:00 PM

Janus Grids??
Anybody have any experience w/the Janus GridEx 2000? I downloaded the trial version, and it is really powerful, but wanted to see if there was any "real people" testimonies before I buy the license. The website for it is www.janusys.com. I am using VB 6.0 Professional Edition. Any feedback, positive or negative, would be wonderful. Thanks a million. If any of you guys have a grid that worked for you, let me know about that too, please. TIA

Janus GridEX
To anyone who is knowledgable about Janus GridEXs

I have just started using the Janus's GridEX and have been able to set it up and populate it with a child (CSLA) datasource, but I cannot add a new record (row) to the grid. Also, when I update the existing data it does not enable the Save button.

Eventually I want to use dropdowns on certain columns that would allow the user to populate the current row with info from another table or datasource.

Any help in resolving these problems or just send me in the right direction would be appreciated.

Cliff B

Janus GridEx
it has a error when i try to convert my .vbp project, it says "does not contain references to GridEx 1.5 or buttonbar 1.2 components, any suggestions?

Janus GridEX Question
Per Peet's suggestion, I tried out and ended up buying Janus' GridEX control.

I really like it BUT... they can take an awfully long time to respond to my email requests for help. Although they do give good answers eventually, I can't wait around for day(s)...

So I'm gonna post my questions in this forum because I can count on getting "instant" results here !!!

OK, enough sucking up----

I know that this is probably pretty basic but I've only been at this VB stuff for a couple of months so bear with me....

I've got the code that let's me grab the fieldname of the column header that I right-click on:
------------------
Private Sub GridEX1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim colClicked As JSColumn
Set colClicked = GridEX1.ColFromPoint(X, Y)
MsgBox GridEX1.Columns(colClicked.Index).Caption
End Sub
------------------
Now here's what I want to do==========
In that same right click I want to create a ValueList of all the (unique) values that are in the current recordset...in other words...I want to create a "dropdown" list that the user can select from---
That is:
User right clicks on the "Name" column and a dropdown list is populated with the values of the "Name" field...

Hopefully this question makes sense.

Thanks,
John


p.s.
If it matters, this is how the grid was filled with data:
Let me know if you need anything else.

Public Sub fill_GridEX1()
GridEX1.DatabaseName = ConnectionString
GridEX1.RecordSource = DBTableFieldForm.Text1.Text
GridEX1.Rebind

GridEX1.LoadEntireRecordset

End Sub

Janus GridEX Control 2.0
Help!! I have a user trying to use our software who when trying to go into the program, gets this error box:

Janus GridEX Control 2.0
Catastrophic Failure

I have loaded MDAC 2.7 and the latest Jet Service Pack for windows XP. Have reinstalled the software at least three times and registered gridex20.ocx successfully. Does anybody please have any ideas?
Any help would be greatly appreciated
Thank you

Janus GridEX - Problems With Scrollbars
Does anyone know how to force a Janus GridEX to display scrollbars? Sometimes when the grid refreshes, it does not display scrollbars even though it should. I could not find any methods or properties to do this so I don't know if there's an easy way to display scrollbars or not...

I am using VB6 and Janus GridEX 2000.

Thanks in advance!

EDIT: It is the veritical scrollbars that sometimes don't appear; I don't seem to be having any problems with the horizontal scrollbars.

Janus GridEx 2000 Control
Ok , I am getting this really weird error in the JanusGrid. It happens on the rebind method. As soon as it hits this method, I get the following error message from the janus grid control (i.e. it doesn't default to my errorhandler but is raised by the control itself):

Syntax Error or Access Violation

I'm doing something I've done quite a few times before and it's always worked before so I'm not sure what the problem is. I'm just dynamically setting the SQL string for the recordsource property then calling the holdfields method and then the rebind method. Any ideas on what this error message means?!? I don't even know where to begin.

axMain.RecordSource = m_oViews.Item(Item.Key).DataSQL
axMain.HoldFields
axMain.Rebind ----this is where the error happens

m_oViews.Item(Item.Key).DataSQL = EXEC sp_GetBookMaster DEFAULT DEFAULT DEFAULT and just as an FYI I have tested this SQL statement and it works just fine so I know that's not the problem. Any thoughts?

Exporting Data From Janus GridEx
I currently have a form that contains 3 text boxes and a Janus GridEx.  When the 3 text boxes are filled with information, a run button is pressed and calls a stored procedure that will populate the grid.  There are 7 columns in the grid.  Only one of the columns is editable and left blank so the user can enter data into that column.  Is there a way to export the contents from the Janus GridEx to Excel or a spreadsheet of some sort?  I am able to export the data to Excel from the stored procedure, however that doesn't include the data the user enters in.  I need the spreadsheet to contain all of the data that the user entered in as well.  Any suggestions would be much appreciated.  Thanks.

Brad

Janus GridEx 2000 Control
Ok , I am getting this really weird error in the JanusGrid. It happens on the rebind method. As soon as it hits this method, I get the following error message from the janus grid control (i.e. it doesn't default to my errorhandler but is raised by the control itself):

Syntax Error or Access Violation

I'm doing something I've done quite a few times before and it's always worked before so I'm not sure what the problem is. I'm just dynamically setting the SQL string for the recordsource property then calling the holdfields method and then the rebind method. Any ideas on what this error message means?!? I don't even know where to begin.

axMain.RecordSource = m_oViews.Item(Item.Key).DataSQL
axMain.HoldFields
axMain.Rebind ----this is where the error happens

m_oViews.Item(Item.Key).DataSQL = EXEC sp_GetBookMaster DEFAULT DEFAULT DEFAULT and just as an FYI I have tested this SQL statement and it works just fine so I know that's not the problem. Any thoughts?


Shane A. McGarry
Software Architect

Janus GridEX Control 2.0 Catastrophic Failure
Hello,
I have a complete pain of a problem! I have a user who when trying to access our system (programmed in VB6) he gets the above error. He can press ok and go into the system but anytime he tries to use any of the features he gets the above message again.
I have installed MDAC and Jet and ran a registry clean up. Re-installing the software also does not help.
Our software keeps an error log and in this users error log it says:

Error Number  : -2147418113
Description   : Catastrophic failure
Build Number  : 214
Application   : InEngine2_0
Module Name   : LockSystem
Procedure Name:
Line Number   : 40
Date and time : 01/10/2003 14:44:17

Does anyone have any ideas? Help would be greatly appreciated!!
Thank you


Best "grid" Component For Editing Recordset With Columns NOT In Order
What is the best data "grid" type component to use? My users need to edit, insert and delete records. I am using ADO recordsets pulled from a mySQL data base. It is a hard requirement that I rearrange the order of the columnsfields. When the user sees the grid, the columns need to be in the specified order, which is NOT the same as the field order of the underlying table.

I have tried a datagrid and made some of the columns invisible, but don't know how to rearrange the remaining columns. I'm trying MSFlexGrid now, but don't think I can rearrange columns in it either.

HELP!

Thank you.

MSHFlexrid Autosize Question/problem - Extra Columns After Sizing Columns To Autofit
I'm trying to use the MSHFlexGrid control, and it's almost a great thing, but not quite.

I wrote a VB app ( I'm a newbie, and my background is midrange program coding specifically RPG on an AS/400 so please keep that in mind. Event-driven programming and VB are new to me.) that will allow users to "drive" the application and select how they want to see the hierarchy. I let them choose from the pertinent fields and they are popped into a listbox control. The order in which they appear in the listbox control determines the hierarchy, and the underlying code writes the SHAPE, APPEND statements, etc...

So far, great... The problem I have is that since I have no way of knowing what hierarchy the user will select when they run the app, I have no way to know which columns will appear in the grid, or in what order, so there is no way to pre-size the column widths.

I found an autosize routine here posted by FlyGuy, so I put that code behind a button on the form called "AutoFit". When I run the code, it resizes the columns beautifully, but the column headings disappear from the sections over the "children" "grandchildren" "greatgrandchildren" , etc... columns.

Then if I do a collapse/expand, I find that the MSHFlexGrid control has a bunch of empty columns now between the original parent and child columns. The number of columns which appear are equal to the total number of child, grandchild, greatgrandchild, etc... columns fully expanded outward, so in the example shape statement below, I wind up with 16 empty columns on the control. Every subsequent autosize leaves the control with more blank columns. If I scroll far enough to the right, I find the children with their column headers.

The question I have is what is causing this ( the empty columns and the disappearing headings ) to happen, and can I do anything to stop it? I'm not sure it's usable for the end users if this continues to happen. Should I ( or can I ) dynamically set the column widths on the control at run time? Should I load the control by trying to iterate through all the recordsets and maybe do some sort of writing to the control directly? Is there a way to stop the control from showing the repeating columns in the children ( like maybe especially if I write directly to the control )? Can I ( if I write to the control ) format the columns so that numbers are right justified?

I'm using VB6 under Windows Xp Service Pack 2, and service pack 6 for Visual Studio 6 has been applied.

Here is how I was doing it: ( Warning: ugly code alert ):

Dim cnmx As ADODB.Connection
Dim rsMX As ADODB.Recordset


Set cnmx = New ADODB.Connection
Set rsMX = New ADODB.Recordset
With cnmx
.CommandTimeout = 0
.ConnectionTimeout = 0
.Provider = "MSDataShape"
.Open "dsn=<the dsn>;User ID=<the account>;Password=<the password>"
End With

rsMX.Open SQLShapeStatement, cnmx, adOpenStatic, adLockReadOnly, adCmdText

On Error Resume Next

If Err Then MsgBox Error
Set Form3.MSHFlexGrid1.DataSource = rsMX

Form3.MSHFlexGrid1.CollapseAll

rsMX.Close
cnmx.Close
Set rsMX = Nothing
Set cnmx = Nothing

Load Form3
Form3.Show

The value of the SQLShapestatement is:

SHAPE {SELECT USAGECOSTCENTER as Dept, cast(round(SUM(COST), 2) AS decimal(9, 2)) as DeptCst From V_ISSREC_WITH_COST_AND_ASSOCIATES Where issuedate between '8/1/2007' and '8/17/2007' GROUP BY USAGECOSTCENTER ORDER BY DeptCst DESC} AS Level1

APPEND ((SHAPE {SELECT USAGECOSTCENTER as Dept, coalesce(left(EQNUM,6),(right(USAGECOSTCENTER,4) + '99')) as Equip_Num, cast(round(SUM(COST), 2) AS decimal(9, 2)) as Equip_NumCst From V_ISSREC_WITH_COST_AND_ASSOCIATES Where issuedate between '8/1/2007' and '8/17/2007' GROUP BY USAGECOSTCENTER, coalesce(left(EQNUM,6),(right(USAGECOSTCENTER,4) + '99')) ORDER BY Equip_NumCst DESC} AS Level2

APPEND ((SHAPE {SELECT USAGECOSTCENTER as Dept, coalesce(left(EQNUM,6),(right(USAGECOSTCENTER,4) + '99')) as Equip_Num,ITEMNUM as Part_Num, cast(round(SUM(Quantity), 2) AS decimal(9, 2)) as Part_NumQty, cast(round(SUM(COST), 2) AS decimal(9, 2)) as Part_NumCst From V_ISSREC_WITH_COST_AND_ASSOCIATES Where issuedate between '8/1/2007' and '8/17/2007' GROUP BY USAGECOSTCENTER, coalesce(left(
EQNUM,6),(right(USAGECOSTCENTER,4) + '99')),ITEMNUM ORDER BY Part_NumCst DESC} AS Level3

Append ({Select USAGECOSTCENTER as Dept, coalesce(left(EQNUM,6),(right(USAGECOSTCENTER,4) + '99')) as Line_Num, ITEMNUM as Part_Num, description as Prt_Desc, cast(round(QUANTITY, 2) AS decimal(9, 2)) as Qty, cast(round(COST, 2) AS decimal(9, 2)) as Cst, issuedate as Iss_Dte, Name as Emp_Nme From V_ISSREC_WITH_COST_AND_ASSOCIATES Where issuedate between '8/1/2007' and '8/17/2007' ORDER BY Cst DESC, Emp_Nme, Iss_Dte} as Level4

RELATE 'Dept' to 'Dept','Equip_Num' to 'Equip_Num','Part_Num' to 'Part_Num' )) RELATE 'Dept' to 'Dept','Equip_Num' to 'Equip_Num' ))
RELATE 'Dept' to 'Dept' )


Any suggestions welcome.

Copyright © 2005-08 www.BigResource.com, All rights reserved