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




Retrieve Values From A Hierarchical FlexGrid


Hello all;

For the first time, I am exploring the Hierarchical flexgrid control. Much to my surprise, I have not yet found a way to retrive values from a row when the user clicks on a given cell. Also, is there a way to prevent the user from selecting multiple rows? Thanks,

DA




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Retrieve Value From MS Hierarchical FlexGrid ?
If I have id, amount columns, how can I retrieve the id of the row the user clicked ?

Resize All Columns In Hierarchical Flexgrid With Hierarchical Recordset
i'm using the following code to resize the columns of a hierarchical flexgrid so that the columns fit the cell contents:


VB Code:
Dim row_num As Integer    Dim col_num As Integer    Dim max_width As Single        For col_num = 0 To flexgrid.Cols - 1        max_width = 0        For row_num = 0 To flexgrid.Rows - 1            If max_width < TextWidth(flexgrid.TextMatrix(row_num, col_num)) Then                max_width = TextWidth(flexgrid.TextMatrix(row_num, col_num))            End If        Next row_num        flexgrid.ColWidth(col_num) = max_width + 240    Next col_num


This works great, but does not work when i display a shaped / hierarchical recordset in the flexgrid where there is more than one band.

I tried the following, but it just fudges up the first few columns.


VB Code:
Dim row_num As IntegerDim col_num As IntegerDim max_width As SingleDim band_num as integer    For band_num = o to flexgrid.bands -1    For col_num = 0 To flexgrid.Cols(band_num) - 1    max_width = 0        For row_num = 0 To flexgrid.Rows - 1            If max_width < TextWidth(flexgrid.TextMatrix(row_num, col_num)) Then                max_width = TextWidth(flexgrid.TextMatrix(row_num, col_num))            End If        Next row_num        flexgrid.ColWidth(col_num) = max_width + 240    Next col_numnext band_num


Anyone got any ideas?

Hierarchical FlexGrid
I'm having a hard time finding out exactly what this is. Can someone give me an example. Is this the control that is used in Kazaa's "Traffic" window, or Outlook's "Inbox" window?

MS Hierarchical Flexgrid
I have a question concerning the MS Hiercharchical Flexgrid. I'm using the grid to display information from a database. When the information is displayed in the grid some of the information is cut off because the columns are not wide enough. Is there a way to have the grid automatically compensate for the different widths? Any help would be appreciated.

Thanks,
CodeHunter

Hierarchical FlexGrid
Im using Hierarchical FlexGrid to display data, it's linked to a recordset and by that record set I have text boxes with more info. To navigate into the record set I have the usual movenext/previous buttons.

I managed to change the record when I click on the grid with this code
=========
Private Sub FlexData_Click()
rsConnection2.MoveFirst
rsConnection2.Move FlexData.Row - 1
End Sub
==========

but now what I need to do is to change the selected row on the grid programmatically via my movenext button...

if anyone has any idea on how I could do this...

Hierarchical Flexgrid Help
I created a recordset and bound it to a hier. flexgrid to display the recordset. Upon selection of one of the rows in the grid, I would like the values of the selected row transfered to property variables of an object. I can select, but not transfer. Help please.

Using A Hierarchical Flexgrid
Hi All,

I ve used a flexgrid many time in vb, and would like to find out how to use a hierarchical flexgrid on my form and what code should I use to populate the different levels of my grid. I asume it would almost be like populating a tree view

Thanks

Hierarchical Flexgrid
If you can not make changes to a database using the flexgrid, how can you use it with a text box?  I'm using the ADO ActiveX data library 2.0 and trying to modify a field in a table I'm connected to using the flexgrid.  Each book I read indicates it is not possible to do directly but is possible with a text box.  But how?

Hierarchical FlexGrid
Hierarchical FlexGrid

How can I programmatically make a column invisible, change width of columns, etc.?

Hierarchical Flexgrid Scrollbar
Hi!!

How canI do to move down the vertical scrollbar from code??


thank you

Should I Use Datagrid Or Hierarchical Flexgrid Or
I am confused between this components(Datagrid,dbgrid, msflexgrid,and the rest ..)..basically i know what they are used for but whats the difference between them..I am using DAO to create an application and i need to use dbgrid or whatever grid to display data , data entry.. the user can selet the data using combobox or list which is a column on the grid. The combo box gets the values from another table..

I am not to sure but i think certain grid cannot display data from multiple table..is that true..

please clarify my confusion on this grid..because i really need to get them working..

thanking you in advance..

regards pragash

Hierarchical FlexGrid Error
Runtime error '30022'
"The Hierarchical FlexGrid does not support the requested type of data binding".


Hi,

I am trying to execute different queries from a kind of small editor and the first time e.g. SELECT * from table, goes well but the next one when I try to run for example DELETE query I get this 30022 error message in the following code

Private Sub Command2_Click()

Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open Text1.Text, dbstr
Set MSHFlexGrid1.DataSource = rs

MSHFlexGrid1.ColWidth(0, 0) = 300
MSHFlexGrid1.ColWidth(1, 0) = 0
MSHFlexGrid1.ColWidth(2, 0) = 600
MSHFlexGrid1.CollapseAll

End Sub
Thanks in advance!
Alex

How To Format MS Hierarchical Flexgrid
I'm using the Shape command to create a hierarchical dataset for use with MSHFlexgrid. I want to be able to display the grid such that each chapter has its own column headings, and each chapter is indented from its parent (like a treeview). I think I saw an example of this somewhere, but so far I have not been able to come close to replicating this in my project, and wonder if it's even possible. Thanks.

Dan

example

Col A1Col A2 Col A3
data data data
---Col B1 Col B2
---data data

About Hierarchical Flexgrid Control
Dear Friends,

I am very thankful to all for being helpful in my problems.

I've one problem which I am facing since long and couldn't find any solution for that since long eventhough I asked many.

Now problem is that I want to set datasource of gird at run time. e.g. if I select department from combo box, it should display list all the employees working that department in the grid. Its working fine in case if I select department in which i've entered employees. But suppose if I select a department in which still I've not entred any employees grid will be displayed as blank. and after that i select again another department in which i've got employees it starts problem in navigation. if i click on 2nd row, its select 1st row and if i select 3rd row it selects 2nd row. so i face problem in navigation in the grid.

plz help

Hierarchical Flexgrid Usage
Hello everybody

I`ve read that I can use the hierarchical Flexgrid control to display a hierarchical relationship between two tables. I know how to use the plain Flexgrid control. Does anyone know of a tutorial or some code in the forums to get me started?

Confuse..about Hierarchical Flexgrid
have a problem here..
i display the saved record using this method (use hierarchical flexgrid)

VB Code:
set mshflexgrid1.datasource = rs

and when i'm deleting it i'm using SQL syntax

VB Code:
DELETE FROM tbl1 WHERE [id]='bla2'  
1.is this a good method?

to display it again after delete..i use this syntax

VB Code:
if rs.state=1 then rs.close'using shape commandsSQL = "SHAPE ...           "APPEND ...          "RELATE ... 'forgot the rest of the syntaxrs.open sSQL, conn, adopenkeyset, adlockreadonlyset mshflexgrid1.datasource = rs
but it several occassion..it doesn't display the right record (the records already been deleted displayed again)..it seems need +- 3s for ACCESS to deleted so my recordset can grab the right record
2. how to fix this?

any suggestion??
thx

Hierarchical FlexGrid Column
Hi,

i have a simple question. How i can edit column width in Hierarchical FlexGrid (child columns). I have one (main) column and two (child) columns.

This code works:
****
With grid
.ColWidth(0) = 1200
End With
***

But this doesnt worK:

with grid
.ColWidth(0) = 1200
.ColWidth(1) = 1200
end with

Tweety99

Hierarchical FlexGrid Problems
Hi

I am using the Hierarchical FlexGrid (HFG) but I am having trouble finding a good way to retrieve a single record when I select a row (an entire row is selected when I click on it) in the HFG. This is the method I am using at the moment:

Private Function Get_Client_Record() As adodb.Recordset
Dim strClientID As String

strClientID = hfgClients.TextMatrix(hfgClients.Row, 0)

strSQL = "SELECT * FROM clients WHERE client_id = '" & strClientID & "'"

Set Get_Client_Record = cnLeadingTheWay.Execute(strSQL)

Get_Client_Record.ActiveConnection = Nothing
End Function

This does exactly what I want, but relies on the Client_ID (Primary Key) being displayed in the HFG.

Is there a way to do this but without the HFG TextMatrix property???

Hierarchical Flexgrid Control
Hi

I use a Hierarchical flexgrid control to show the data from a database. I have a text box to let user enter the order no.
After the user enters the order no and click the button, I want the order no in the flexgrid be displayed in green and shown in current page.

My following works for the first part . that is the order no in grid can be found and displayed in green. but I must use the scroll bar to find it if it is on other page.

Please help me!!!

Private Sub Command1_Click()
Dim intCtr As Integer
Dim plngExtractNo As Long

plngExtractNo = txtFindExtractNo.Text
For intCtr = 1 To msfgExtraction.Rows - 1
msfgExtraction.Col = 0
msfgExtraction.Row = intCtr
If plngExtractNo = CLng(msfgExtraction.Text) Then
msfgExtraction.Row = intCtr
msfgExtraction.Col = 0
msfgExtraction.CellBackColor = &HFF0000
msfgExtraction.SetFocus
Exit For
End If
Next

End Sub


Thanks

Printing A Hierarchical Flexgrid ?
All,

Trying to print a hierarchical flex grid, in which I have merge rows/cells enabled. Currently, I am
using a "Screen.ActiveForm.PrintForm" which quality wise looks fine, but it is only capturing the visible
part of the grid. Q: Is there a way to use the ActiveForm.PrintForm method and capture any part of the grid that
is hidden. Q2: What would be the best alternative way to handle printing a grid ?

I've also heard of the "paintpicture" way of doing this ??

Thanks in Advance,

DataGrid Or Hierarchical FlexGrid?
DataGrid or Hierarchical FlexGrid? ...?

I Got A Problem On MS Hierarchical Flexgrid
I got a big problem on MS Hierarchical Flexgrid. I display data using MSDatashape it will retrieve the data but the big problem is It does not display all the records... anyone who knows to solve this?

Hierarchical Flexgrid Customized
HI
How do you set the column width in the hierarchical flexgrid with custom column headers?

Hierarchical Flexgrid - Textmatrix
Hello
I use MSHflexgrid. When I populate it with hierarchical recordset how to change the column headers?
The headers are the field names in the h. recordset. I want to change them.

I've tried to use textmatrix(0,column)="New Name" but id doesn't work. I have a recordset with 3 levels (3 bands).
But it works only for band 0. (1st level)

(look at the attached picture)
textmatrix(0,1) returns "Datum"
textmatrix(0,2) returns "FinishedDate"
textmatrix(0,3) returns nothing or it generate an error If I try to assign the value (string) - same for the rest of the cells in this row

but textmatrix(1,3) returns "Prac_C"

thanks for help
m.



Edited by - plsanek on 10/7/2006 12:59:15 PM

Formatting In Hierarchical FlexGrid
Im using ADO control to fill a hierarchical flexgrid. The backend in MS Access. The table contains a field for holding PRICE. I want the price to be displayed as 12.00 but the grid is ignoring this format and shows as 12, 45.9 etc.,
I want the ##.## format i.e, there must be the .00 part even if there are not fractions.

Hierarchical Flexgrid Using Changing Recordset
I am populating a hierarchical flexgrid with a disconnected recordset mrstList. The query used looks like this:
Select
     ID           ' Identity field, primary key
     Field1,
     Field2 = Substring(Field2, 1, 5) + ' ' + Substring(Field2, 6, 3)
From MyTable

The Recordset property of the grid is set to the resulting recordset derived from this query.

The grid is used for selecting a record, which is loaded into another recordset, using the ID field in the query.

When a new record is added/deleted to/from the table, I would like to update the grid without re-loading the recordset(making a round trip to the server). This presents various problems.

1. If I use AddItem/RemoveItem methods, I invariably have problems in other portions of my code involving the Rows property.

2. My preferred solution would be to update mrstList, clear the grid, and re-apply the recordset. However,
when I try to update the recordset, I have some problems.

Here is the code:

    With mrstList
        If mblnAdding Then
            mrstList.AddNew
        End If
        lngID = mrstData!ID
        !ID = lngID       'Problem 1
        !Field1 = Str2Field(txtLabNumber.Text)
        strData = NoSpace(txtField2.Text)
        !Field2 = strData 'Left(strData, 5) + " " + Mid(strData, 6, 3)           ' Problem 2
        .Update

Notice that I know the new ID field from the master recordset. However, it can't be saved to mrstList, because it has a field property of Identity also(ISAUTOINCREMENT = True).

Secondly, Field2 has an unknown field property(BASETABLENAME = Null). Therefore, it won't accept an Update either.

I am looking for any suggestions related to this problem.

Thanks

Hierarchical Flexgrid Vs Removeitem Method
How can I remove a Row inside a Band in a Hierarchical Flexgrid, becouse the Removeitem method does not accept the second argument "band"?

Thanks in advance.

Problem In Selecting Using Hierarchical Flexgrid Control
Hello Friends,

I've used hierarchical flexgrid control in software to dispaly data. Now problem with that is when I start my form, grid doesn't have any data to display as database table which is linked to that form is empty. Now I've entered few data in that and as and when I entered those data is getting displayed in grid. After entering few data, i need to select one row from that grid and display it. But as grid was initially empty and then it is getting filled it doesn't allow me to select row which i clicked. Rather if i click on 2nd row, it displays data of 1st row and if i select 3rd row it display 2nd row. so ultimately i've to click one row down in order to select appropriate entry. And this problem comes only when grid is empty and then later on it is getting filled.

Plz help me soon as i m facing this problem since long.

Thanks

** RESOLVED ** Hierarchical Flexgrid Sorting Question
Is it possible to do a multiple sort on an MSH flexgrid ?

i.e. Sort by column 3 within column 1.

I know how to do single sorts, and am assuming I can't do this unless I create a "dummy" column populated with values and sort on that.


Any takers ?


Cheers.

Sort By Column Header In Hierarchical Flexgrid
Hi everyone,

I'm trying to allow user to view sorted data from a Hierarchical Flexgrid in my VB6 program.

To do this, the user should click on a column header in the Hierarchical Flexgrid and all the data in the Hierarchical Flexgrid should be sorted according to the column header selected.

The problem is, the column header is a "fixed column" and the user is not able to sort data via the column header by clicking on it (eventhough I've set the "AllowUserResizing" property to "1 - flexResizeColumns").

What should I do? Please help.
Thanks very much.

Here's the codelines
(Sorts data only when row = 1 and not row = 0, as desired):


Code:

Private Sub MSHFlexGrid1_Click()

With MSHFlexGrid1

Dim myCol
myCol = .ColSel


'This line will not work :
'If .row = 0 Then

If .row = 1 Then

.col = myCol
.Sort = 1

End If

End With

End Sub

Problem Loading Hierarchical Flexgrid Control In Vista
I need to load Microsoft Hierarchical FlexGrid Control in Excel 2007 and Windows Vista.
I already put MSHFLXGD.OCX file in c: WINDOWSSYSTEM folder, but when I try to add it (through Tools>>>Additional controls) it does not appear.
I have done this several times using Office 2003 and Windows XP and I haven´t had any problems.
Any clues?
Thanks in advance

How To Decide Sorting Descending Or Ascending In A MS Hierarchical Flexgrid ?
MSHFlexgrid1.sort = 1 , Then, How can I command descending or ascending ?

Superimposing Textbox And Listbox In A Flexgrid To Enter Values In Flexgrid
Hi,
    I had done a project(VB6) where I placed a textbox in flexgrid to enter data in flexgrid.After that I tried using textbox and listbox to enter data.When i press a key(FlexGridKeyPress Event) the textbox is made visisble in the current cell of flexgrid.the listbox is filled with values, so that when i enter data in textbox,listbox will be made visisble just below textbox appearing as if it is a combobox and depending on the values i enter in textbox the listbox scrolls up (if there is matching text entered in textbox) and by using arrow keys(keyboard) (event :- txtKeyDown event, kCode:-keycode=35)
i should be able select a value from listbox and the selected value(if selected) should be
displayed in the textbox.After that on enter key press (Keyascii=13) the textbox and
listbox should be made invisible(visible=false) and either the selected value from listbox or any text I enter in textbox should be displayed in the current cell of FlexGrid and after that focus should goto next cell same row in the flexgrid.I was able to bring the text box and listbox in the proper places but could not do the rest.Please can u give me
the solution with source code




Edited by - sanththomas on 7/7/2002 6:49:21 PM

Retrieve Flexgrid Information
Hi, this is my code to display the content of prn file to a flexgrid but I do not know how or which property to used to capture or tranfer the content of the cell data to another string variable. I like to create a click event to do that, any help thanks.

Private Sub Form_Load()
Dim strDisplay As String
Dim i As Integer
Dim count As Integer

MSFlexGrid1.ColWidth(0) = 5000
CommonDialog1.Filter = "PRN FILE (*.PRN)|*.PRN"
CommonDialog1.ShowOpen
Open CommonDialog1.FileName For Input As #1

Do While Not EOF(1)
Line Input #1, strDisplay
MSFlexGrid1.AddItem strDisplay
Loop



End Sub

Private Sub MSFlexGrid1_Click()

'I don' know how to retrieve the content of cell information (data)


End Sub

Need Help In XML And Vb To Retrieve Values
Hi all,

I have XML file as shown below:
Code:
<log>
<Fruits>
<date>18-Apr-2005</date>
<time>16:14:22<time>
<Stock>
<item>Banana</item>
<item>Apple</item>
<item>Grapes</item>
<item>Mango</item>
<item>Others</item>
</Stock>
</Fruits>
</log>
I need output like:

Banana
Apple
Grapes
Mango
Others

i.e., I want to retrieve the value in between <item>, </item>.

I searched the forum but haven't find anything like my request.

Please help me on this.

Thanks in advance.


Kanna.

How To Retrieve Values
i use common dialog box to open and select the particular file in a path. if i select a particular filename and click open in the dialogbox, then the values inside that file should be retrieved in the listbox.how it is possible using vb coding? similarly, if i open a folder the filenames in that folder have to be displayed in the listbox. please give me coding for the above two.

Retrieve Listbox Values
Hey, I am currently using this code to store values from different text boxes into a listbox on another form which works fine.

If cust.Text <> "" And days.Text <> "" And Location.Text <> "" And Date1.Text <> "" Then
cust1 = cust.Text & " " & days.Text & " " & Location.Text & " " & Date1.Text
Form4.customer.AddItem cust1, 0
End If


The problem I am having is that I don't know how to retrieve all the values of the listbox and store them as a variable

Retrieve All Registry Values Under A Subkey
I'm fairly familiar in using the registry... i have a program that dumps multiple values under a subkey... Is there any way to determine ALL the value names under this subkey without knowing the actually value name... Basically a way to return the number of values and their names....

Strore And Retrieve X,y Position Values
Could anyone help me with a way to store the
x,y values of the positions clicked on a form and then pass these values to another form as x,y values?

How To Retrieve Values From Active X Control
I have created a very simple Active X Control for use in ASP pages using VB 6 just to do some playing around.  It consists of nothing more than a ListView control.  Now, if I were to actually use this in a production environment how would I be able to grab the values out of the Control for insertion into a Database??  Thanks.

Enumvalues - How Do You Use This To Retrieve Values For A Registry Key?
Hi,
I have found no documentation on this enumvalues function in VB. It is used to return all the values in a registry key.. but how do you do this?? Thanks in advanced.



Edited by - Marce22 on 12/21/2004 1:46:54 PM

Retrieve Values From Excel Graph
Hi,

In Excel i want to retrieve the values from a graph with Visual Basic.

Anyone knows how to do this?

Retrieve Values From A VSFlexGrid On Browser
Hi all,
How do i filter out values from a VSFlex grid control which is on the browser onto an asp page?
For eg: I have made an Active X control and have included it into an HTML Page(assume x.html) by using the &lt;OBJECT&gt; Tag.. The user is able to add values into this VSFlex Grid and on submitting this page (x.html) to a page (y.asp) how can i read the contents of the grid since i am unable to pass the grid using neither the GET nor the POST method ????

I am not using any data control to populate the Grid but the grid is dependent on values entered by the user on the browser


Any takers ???

Thanks u've been of great help

Regards
Ashvin

Retrieve &lt;select Multiple&gt; Values In ASPs
hi, how do i retrieve the values from a <select multiple> tag from a form in ASPs???

thanks

Please Help.. How Can You Save Values Of All Checkboxes To Registry, && Retrieve Them?
Heres the code im using to save values of all checkboxes into the registry..

VB Code:
Dim x As ObjectFor Each x In Form1    If TypeOf x Is CheckBox Then        SaveSetting "ProjTest", "Settings", x.Name, x.Value    End IfNext x

and heres the code to retrieve the values

VB Code:
For Each x In Form1    If TypeOf x Is CheckBox Then        x.Value = GetSetting("ProjTest", "Settings", x.Name, 0)    End IfNext x

however, if the checkbox is an array, then the code will not work, because the naems of Check(1), Check(2) and Check(3) are all "Check"..

anyone have a method of saving and retreiving the values that will work with arrays too?

I guess what you can do is save the index as well (ie save x.Name & "," & x.Index") and then when retreiving values use split to apply the settings... but im not sure how to do that part

anyone know?

Need To Retrieve And Updated Values In MS Excell Sheet In VB6
I want to acces a MS Excell document and retrieve values from it in a VB6 program. Also need to updated the document with new values.

Appreciate your help regarding this matter.

Saman Wickramanayake

Retrieve And Display Numerical Values From A Table On The Internet
As my title says i am having trouble to display numbers from a table on the internet i am just using Visual Basic

Note: i want to display them in text boxes

MSChart: How To Retrieve Data Values From Mouse Over/click On Xy Plot?
I hope someone out there can help me. I've been reading Microsoft's miserable excuse for online help all night and am getting very frustrated.

There seems to be no way to extract plotted values from the chart. I am not using the MS datagrid for this, just filling the chart from an ordinary 2-D array.

I want to display x and y values in a label as I move the mouse over different parts of the scatter plot (or if that won't work, at least have the x-y data displayed when the user selects a data point). Anyone know if this is possible? It seems it certainly should be.

I would be greatly appreciative for any insights from anyone. Also, are there any good resources to learn about MSchart in gory detail? I've looked at dozens of books and searched the web and never found a good, complete source.

Thank you.

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