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




Flexgrid Highlight Rows


For some reason my flexgrid will not highlight the rows if they are clicked. I have it set to hightlight always in the properties and I also have

DPlanflex.HighLight = flexHighlightAlways

in my form_load. I also have tried this in my code but it leaves the previous row highlighted.


With DPlanflex
.RowSel = .Row
For i = 0 To 8
.Col = i
.CellBackColor = &H8000000F
Next i
End With


Any ideas?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Do I Highlight Multiple Rows In Flexgrid Randomly
for example, there are 10 rows in the flexgrid and i want to select rows 1,2,4, and 8...how can i select the rows using ctrl + click? right now i'm only able to select multiple rows that are together (ex. rows 1,2,3,4).

Autosize Rows In Flexgrid & Loop Through Flexgrid
How to autosize the rows and column in flexgrid?
Mr Flyguy in your tutorial I have tried it but how to call the function

FG_autosizerow(dbgrid) --> i Have tried this but it wont work

How to make my first column of flexgrid enable true and the other column false enable

eg:

1 2
aa ww
aa ww
aa ww
I want the 1st column being enable and the 2nd column false enabled

How to achieve this

Thx

Highlight Rows In Excel/VBA
Hello all,

I think this is a simple one. I need to highlight a row in excel according to the value in a particular column. i.e g6="booked"...turn row 6 to green. I have a total of about 200 rows that need to be highlighted for better viewing. I tried conditional but that does not span across the entire row or sheet. It has been a while since I have had my hands in VBA so any help would be appreciated...

Thanks...

Highlight All Rows In DBGrid
i am using DBGrid. The following code selects only the rows that are visible. How can I select (highlight) all the rows within DBGrid??

VB Code:
Private Sub FSelect_Click(Index As Integer)Dim I    For I = 0 To GridTest.VisibleRows - 1        GridTest.SelBookmarks.Add GridTest.RowBookmark(I)    Next IEnd Sub


Thanks in advance !!!

Highlight All Rows In Mshflexgrid
Hi,

I have 12 columns in my mshflexgrid which means I have to use the horizontal scroll bars.
When i click on say column1 row5 I would like the rest of the columns in that row to become highlighted. Could somebody help me acheive this?

Cheers,

Dzon


How To Highlight All Rows In DBGrid ??
i am using DBGrid. The following code selects only the rows that are visible. How can I select (highlight) all the rows within DBGrid??

[vbcode]
Private Sub FSelect_Click(Index As Integer)
Dim I
For I = 0 To GridTest.VisibleRows - 1
GridTest.SelBookmarks.Add GridTest.RowBookmark(I)
Next I
End Sub
[/vbcode]


Thanks in advance !!!

Highlight Specific Rows With A Logical Test
I'm running Excel with visual basic editor. The code is highlighting the correct row but the logical test is not correct. Example--
in a Module
If (k6 = oxidizer) And (k7 = flammable) And (j6 = j7) Then Worksheets("Sheet1").Range("A6:k6").Interior.ColorIndex = 3
highlighting occurs when k6 does not equal oxidizer.

Highlight Flexgrid
hi,

i need to search in MSFlexgrid.

I'll give the input in a text box and on clicking a button i hav to highlight the row of that name in the MSFlexGrid.

Thank You!

FlexGrid Highlight
I am trying to fix/update some code written by a previous employee. He used the original FlexGrid control (not the newer 'H' version). The problem I'm having is how to detect whether or not a user has highlighted a row in the grid. I can't find any property of the Grid that seems to indicate this. I especially need to trap the situation where NO row is highlighted. What I found so far is that everything seems to remember the LAST time a row was highlighted (Grid1.row etc. points to it). I can't use the Form load to handle this because many things happen after the form is loaded. I also can't arbitrarily set the row pointer because other code relies on it being left at the next empty row in the grid. Any ideas?
TIA

Highlight ONLY One Row In Flexgrid
I have used this line in the Form_Load to be able to highlight a row in the FlexGrid:

MSFlexGrid1.SelectionMode = flexSelectionByRow

By using this I can not only highlight one row but many rows. Is there a way to make it so only ONE row will be highlighted at a time?

Highlight A Row In A Flexgrid
Hi! I need to select (highlight or smth!) a specific row in a FlexGrid.
I have a textbox where i type an Id. According to what i've typed i use a function that searchs in the grid for the same value. I need it (if found whole or parcial value -for this i count characters & compare...) to focus the grid & select the correct row.
I found function "Rowsel" & it works fine selecting rows in the grid, moreover because it goes on highligting the rows after loosing focus! But the problem is that it seems to select many rows! ie.: I assing "3" to rowsel & it select rows 0,1,2,3. I need it to select just one row!
Anyone can help me? Thank you very much!

Highlight Flexgrid
hi,

i need to search in MSFlexgrid.

I'll give the input in a text box and on clicking a button i hav to highlight the row of that 'input' in the MSFlexGrid.

Thank You!

Flexgrid Highlight
Hi all. I'm having some trouble with MSFlexGrid, basically I need to perform an action on multiple highlighted cells. For example, I might want to click + drag across the grid to highlight a number of cells, and then hit a command button to change the background colour of the highlighted cells to green.

This is easy when acting on one cell, but when I try it with multiple cells the changes are only applied to the top left cell of the selection.

Any and all advice much appreciated!

Cheers,

Matthew

How To Highlight A Row In Flexgrid?
I'm using a flexgrid in VB6. It has 1 fixed row and no fixed column. I set always highlight, however, it won't highlight the first column. I do not know why. DOes that mean in flexgrid, it must have 1 fixed column? Otherwise, it won't highlight it correctly? I also found that in my case, the first column is always treated by VB6 as fixed column, is it a BUG?

thx.

Flexgrid: Possible To Highlight A Row?
In a flexgrid I can use the topRow property to set which of the rows gets shown, but how can I also have this row highlighted?

Any ideas?
Thanks

FlexGrid Row Highlight
Hi all,

I am using MsFlexGrid in my Project.

If the Flex grid having 10 Rows means, I want I click Command button at the time Flexgrids FirstRow (All Coloumns) will be Highlighted in Various Colour like green, then next 5 minutes the next Row will be Highlighted the previous one is not to be highlighted.

I am using the following codes, but, the particular Row ColCell only Higlighted.

Flex1.Row = 1

Flex1.Col = 0

Flex1.CellForeColor = Vbgreen

any body Know this Particular Row fully Highlighted method. Please send the Code.

Thanking you,

Regards/ S.Suresh Rajkumar

MS Flexgrid Row Highlight
Hi All,

I am showing data to the user on MS FlexGrid.

The user can DoubleClick/highlight a row and click on a button to Edit/process the data.

The problems is that the user can click on a row and drag his mouse and "Highlight" more than one row. (Even though, the last row is "Selected"), but the user gets a feeling that more than one rows are selected.

So, How do i prevent the multiple Highlighting of the Grid. I have to highlight just a single row; even if the user clicks/drags his mouse, only the selected row has to be highlighted.

Msflexgrid - Highlight Entire Row, Add Rows, Search The Database, Filter Results
hi! i got a code here that can perform everything that is in the title.. for those who are using flexgrid in VB6, you can rely to this code..

there's just 2 glitches with this code.. 1st one:

for example, user searches for record "A"; the program found record A and would highlight that one with its text in bold style.. issue: msgbox "record not found" would prompt the user even if the record was already found or do exists.. can you guys help me with that?? i included a msgbox that would prompt the user if the record does not exist but it also interferes with my existing records..

2nd one:
for example, i can search the database linked to flexgrid1.. the search result would be highlighted with its text in bold style.. it would also filter the results to flexgrid2 so that the user wont have to scroll for other records with similar names.. problem with this code is if i have 3 records as the result:

A
B
C

it will appear in my flexgrid2 like this:

A
B
C
A
B
C
A
B
C

so now, it keeps on showing duplicate results.. is there anyway that i could avoid that??

anyway, here's the complete code that i used:


Code:
Private Sub Command1_Click()

Dim target_name As String

MSFlexGrid1.FillStyle = flexFillRepeat
MSFlexGrid1.Col = 0
MSFlexGrid1.Row = 0
MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
MSFlexGrid1.RowSel = MSFlexGrid1.Rows - 1
MSFlexGrid1.CellFontBold = False
MSFlexGrid1.CellBackColor = &H80000005

MSFlexGrid1.FillStyle = flexFillSingle

For i = 0 To MSFlexGrid1.Cols - 1
For j = 1 To MSFlexGrid1.Rows - 1

target_name = TEXTSEARCH.Text
target_name = LCase$(target_name)

If LCase$(MSFlexGrid1.TextMatrix(j, i)) = target_name Then 'searching
MSFlexGrid1.Col = i
MSFlexGrid1.Row = j
MSFlexGrid1.ColSel = MSFlexGrid1.Cols - 1
MSFlexGrid1.CellFontBold = True
MSFlexGrid1.CellBackColor = &H80FFFF
TEXTSEARCH.SetFocus

MSFlexGrid1.Col = 1 'flexgrid1 (column1) will be copied to flexgrid2 (col1)
MSFlexGrid2.Col = 1
MSFlexGrid2.Text = MSFlexGrid1.Text

MSFlexGrid1.Col = 4
MSFlexGrid2.Col = 2
MSFlexGrid2.Text = MSFlexGrid1.Text

MSFlexGrid1.Col = 8
MSFlexGrid2.Col = 3
MSFlexGrid2.Text = MSFlexGrid1.Text

Dim oldRow As Long 'filters results and also the 2nd glitch
Dim lngRow As Long
Dim lngCol As Long

MSFlexGrid2.Rows = MSFlexGrid2.Rows + 1

For lngRow = MSFlexGrid2.Rows - 2 To MSFlexGrid2.Row Step -1
For lngCol = 0 To MSFlexGrid2.Cols - 1
MSFlexGrid2.TextMatrix(lngRow + 1, lngCol) = MSFlexGrid2.TextMatrix _(lngRow, lngCol)
Next
Next

elseif LCase$(MSFlexGrid1.TextMatrix(j, i)) <> target_name Then '1st glitch
msgbox "record not found"

End If

Next j
Next i

End Sub

Msflexgrid Highlight Rows Based On Conditions At Form Load Time
I am creating a scheduling program that displays current jobs in an msflexgrid, I need to be able to have any rows with jobs that are past due
(where system date is greater than due date of job)

to be highlighted or have a red fontcolor when the msflexgrid is viewed on screen.

Any suggestions would be greatly appreciated.

my date format is mm/dd/yy and is in column 5 of msflexgrid1 if that helps.

Slow Flexgrid Highlight
I have a flex grid with around 4000 rows and 10 column. I'm experiencing slow highlight after i run the code below. Does anyone has any idea why this happen or has same problem? Is there a way to go around it?

(This code is to select first and last 5 record in the flexgrid and hide the rest of the rows)


Code:
RowHeight1 = MSHFlexGrid1.RowHeight(0)
With MSHFlexGrid1
.Redraw = False
For Row1 = .FixedRows To .Rows - 1
If Row1 < 6 Or Row1 > (.Rows - 6) Then
.RowHeight(Row1) = RowHeight1
Else
.RowHeight(Row1) = 0
End If
Next Row1
.Redraw = True
End With

Highlight Flexgrid Cells
Is there anyway to highlight multiple cells, in an MSFlexGrid, across multiple rows? What I have is a flexgrid and a few text boxes. The text boxes contain data that is also held in the grid, sometimes in multiple locations. What I want is to be able to click the text box and have that event highlight the matching cells in flexgrid. Then when that text box looses focus, clear the highlighted data. I have it working by passing the addresses, number of cells, and colors to a function that loops through changing the colors at that address. That works great except for 1 problem. I'm having to use the text boxes lost focus event to change the colors back to non-hightlighted. That causes the focus to always be set back the text box. The problem with that is that I can't then click on a cell within the grid and edit it, because the grid never gets focus. I've tried forcing it using the setfocus function, but am getting erratic results with it if any at all. If I step the operations one step at a time, it works as intended. But when I run it without stopping it messes up. I've also tried delaying for a few seconds and that doesn't help either.

I've used the ColSel property to select cells in the past, but I can figure out how to make it work across multiple rows. Anyone got any ideas? Thanks

Highlight &amp; Focus On Row In Flexgrid
Hi There,
i have a felxgrid displaying info from an access daatabase. The user can add a new record to the database, and he flexgrid reloadsa itself so that the new record is visible. I would like to know how to position the flexgrid at the newly added line and to highlight that line. Any ideas?

Thanks

Highlight The Record In Flexgrid
im using a flxgrid and populating it by setting its datasource to my RS..
when i double click it, the complete details of my chosen record will be displayed in my txtbox controls.. then i have this previous and next button .. the records are moving accordingly but as i move the records.. i want the row of that record be higlighted in my grid.. the selectionmode of my grid is selectionbyrow.. how will i do this? thanks

Highlight Columns In Flexgrid
Hi:

This code Highlight my 8 column in a MSflexgrid:

VB Code:
MSFlexGrid1.Col = 8MSFlexGrid1.SetFocus


But I want highlight too my 2,4 and 6 columns...

Who can I do this?

Thanks

How To Highlight Flexgrid Using Right Mouse Button...help
I am unable to highlight and select a Flexgrid row pointed to by the mouse cursor and clicking the right mouse button...

Pls. anyone can post vb6 code on how to do it...thanks...

Flexgrid Highlight/RowSel Question
I have a command button that clears a row or performs a dB transaction on a flexgrid when clicked. Currently my code operates on a row selected basis. However, I want to force my user to manually highlight the row. I don't want the first unfixed row to be the selected row by default.

How do I go about doing this?

How To Highlight The Value In The Flexgrid If I Give A Find Option
hi all,
i am doing a VB application where in i have a flex grid and the flex grid is connected to the database. the database is huge so i have a find option to get the database value easily. i am using a combo box for the find option. and the firstvalue of each resord is there in the combo box. so what i want to know is, if i take a value and enter, the pointer should go to that particulare value in the flexgrid and should be highlighted with some color.

Urgent How To Multiple Or HighLight To Delete In FlexGrid
Pls Help Me....
Problem:
How to make Multiple delete record in flexgrid.
When i highlight some records in flexgrid then press Delete Button.

Thnks For Help....

Unable To Highlight Flexgrid Fixed Column/Cell
I have a MSHFlexGrid with one fixed row and two fixed columns. SelectionMode is set to flexSelectionByRow. When selecting a row in the grid all of the columns/cells for the select row are highlighted except for the fixed columns/cells. Is there a way to also highlight the fixed column/cells for the selected row?

AlanG

Help - Autoresize FlexGrid Rows
I am trying to create a FlexGrid control in MS Access 97. All is well with the data populating, but because my text is long, I need to use the WordWrap function. Since FlexGrid doesn't autoresize the rows, I need to do it programmatically.

every code i found on the net i think works with VB but not Access. can anyone help?

Transfer Rows From A Flexgrid To Another.
Hello. I have 2 flexgrids, F1 and F2. F1 is populated and F2 is blank. With this code i add rows from F1 to F2:


Code:
Private Sub F1_Click()

With F1
.Col = 0
c1 = .Text
.Col = 1
c2 = .Text
.Col = 2
c3 = .Text
.Col = 3
c4 = .Text
.Col = 4
c5 = .Text
End With

If F2.Rows = 0 Then
F2.Rows = 1
Else
F2.Rows = F2.Rows + 1
End If

F2.TextMatrix(F2.Rows - 1, 0) = c1
F2.TextMatrix(F2.Rows - 1, 1) = c2
F2.TextMatrix(F2.Rows - 1, 2) = c3
F2.TextMatrix(F2.Rows - 1, 3) = c4
F2.TextMatrix(F2.Rows - 1, 4) = c5

End Sub
I want that clicking on F1 to check if selected row exist in F2. If it doesnt exist, add it. Else delete from F2. Is this possible? And if yes, how? Thnx.

Filtering Rows In Flexgrid
Hello, I have an ado data control linked to an mshflexgrid. How can i get the flexgrid to only display rows whose fields have a certain value? That is, I want to filter out rows that do not match certain criteria. Thanks.

Flexgrid Shows No Rows
I've been away from VB stuff for a number of months.
Today I opened up my projects and none of the mshflexgrids shows any rows.
I've got them bound to ado controls. I've tried doing an adoctrl.recordset.recordcount to make sure that there should be rows to show, and I get the correct amount of rows, but the rows never show in flexgrid.
The same is true with all the flexgrids in all my projects.

Flexgrid Adding Rows
I have a flexgrid and I get the data for the grid from a database
hence I have the first row as fixed row.

But I also want the user to add a row above my first show that is displayed
That is effectively add one row above the second row (the first row being my greyed out fixed row).
Since I have that fixed row my foll code does not work

If Me.MSFlexGrid1.Row = 1 Then
Me.MSFlexGrid1.AddItem "", Me.MSFlexGrid1.Row - 1
endIf

any one has any way I can add one row above my first row of data by still having that fixed row.

Thanks

Flexgrid Adding Rows
I am using a MSFlexgrid and I need to add a new row in the middle of
the grid

Assuming that I already have 5 rows with data in it How would I add a new row after the 2'nd row ? After I do that I need to make sure that the values of the rows below it are pushed down. Is this automatically taken care if not How can I do this ?

Thanks

Copying Rows From A Flexgrid
Hi,

I have populated a MSHflexgrid and I am able to select the columns and rows in it by clicking, but can't copy the contents by pressing Ctrl+C and paste in any other application.

Is it possible to copy a single row or column using the usual ctrl+c method on flexgrids?

Thanks

Hitendra

How To Get Number Of Rows In Flexgrid
i select 5 rows in a flexgrid and i want to get the number of rows i selected. if i select 5 i will get 5 rows at the msgbox etc...

I want to do that to delete these 5 lines i have selected from the database...is this possible somehow? please help i use visual basic 6

Add New Item To End Of Flexgrid Rows
Hello,

I've polupated a txtfile to MsFlexgrid control; i need to add new items, but each time i add a new item, it adds the new item to the first row and remove the old item in first row.
that was my code:

Private Sub cmd_add_Click()
Dim LayerF As String
Dim LayerT As String
Dim ColorF As String
Dim ColorT As String
Dim LineTypeF As String
Dim LineTypeT As String
Dim LayerBlock As String

LayerF = txt_lf.Text
LayerT = txt_lt.Text
ColorF = cb_cf.Text
ColorT = cb_ct.Text
LineTypeF = cb_lf.Text
LineTypeT = cb_lt.Text
LayerBlock = txt_lbloco.Text

If LayerF = "" Or LayerT = "" Then
MsgBox "Layer de Entrada ou de Saída não definido.", _
vbCritical + vbOKOnly
ElseIf ColorF = "" Or ColorT = "" Then
MsgBox "Valor de côr de Entrada ou de Saída não definida.", _
vbCritical + vbOKOnly
ElseIf LineTypeF = "" Or LineTypeT = "" Then
MsgBox "Tipo de linha de Entrada ou de Saída não definido.", _
vbCritical, vbOKOnly
Else
If x = 0 Then
x = 1
End If

fgp.Rows = fgp.Rows + 1

fgp.TextMatrix(x, 1) = LayerF
fgp.TextMatrix(x, 2) = ColorF
fgp.TextMatrix(x, 3) = LineTypeF
fgp.TextMatrix(x, 4) = "=>"
fgp.TextMatrix(x, 5) = LayerT
fgp.TextMatrix(x, 6) = ColorT
fgp.TextMatrix(x, 7) = LineTypeT
fgp.TextMatrix(x, 8) = LayerBlock

x = x + 1

txt_lf.Text = ""
txt_lt.Text = ""
cb_cf.Text = ""
cb_ct.Text = ""
cb_lf.Text = ""
cb_lt.Text = ""
txt_lbloco.Text = ""
End If
End Sub


I need to add the item to the end of the flexgrid rows.

António Miranda

How To Count The Rows In A Flexgrid
Hey guys,

I have a flex grid that displays records from a backend mysql table. Is there a property that gives me a total number of records currently being displayed in the flexgrid control?

Please help

Thanks

Removing The Rows In MS Flexgrid
i have written a program which add rows in the Msflex grid dynamically.
Like i have a text box, and rows will be entered based on the value in the text box

Pls tell me how to remove the rows in the MS Flex grid

Counting Rows In Flexgrid
I have a for next loop, i want to count how many of the rows in columnd 0 have text.

This is what i have now,

VB Code:
For i = 0 To grdFields.Rows.Count - 1'....... Next


The only thing is when i do this is counts all the rows in the flexgrid, even the ones with nothing in them.

any help would be greatly appreciated.

Ryan

Copying Rows From A Flexgrid
Hi,

I have populated a MSHflexgrid and I am able to select the columns and rows in it by clicking, but can't copy the contents by pressing Ctrl+C and paste in any other application.

Is it possible to copy a single row or column using the usual ctrl+c method on flexgrids?

Thanks

Hitendra

Not Adding Rows In Flexgrid
I have a form where the user keeps track of income and expenditure. When I click on the add button, if there are already 4 rows (incl fixed) then it does not add another row, but pushes every thing up one row only showing three rows of data. Any suggestions please.
VB Code:
Private Sub cmdAdd_Click()    '...Add new entry to grid    '...put text from textboxes into variables Dim msg As String InputDate = DateDesc = txtDesc.TextIf optAmount(0) Then    Income = Format(Val(txtAmount.Text), "#,##0.00;;""")Else    Expenditure = Format(Val(txtAmount.Text), "#,##0.00""")End If   If grdFinance.Text = "" Then      msg = grdFinance.Rows + 1 & Chr$(9) & InputDate & Chr$(9) & Desc & Chr$(9) & Income & Chr$(9) & Expenditure              'add variable 'msg' to the grid        grdFinance.AddItem msg            'remove empty row (if it exists)        grdFinance.RemoveItem 1Else    msg = grdFinance.Rows + 1 & Chr$(9) & InputDate & Chr$(9) & Desc & Chr$(9) & Income & Chr$(9) & Expenditure         grdFinance.AddItem msgEnd If '...reset value to nothingIncome = "0"Expenditure = "0" txtDesc.Text = ""txtAmount.Text = ""txtDesc.SetFocus End Sub

Thanks
aikidokid

Print Rows In Flexgrid
With the code

Dim MyCells as String
MyCells = grdMembersDetails.Clip

I want to make it print over 2 lines on the page. How would I enter the string to but in the "& VbCrLf &" in place of the "& Chr$9 &" (I think this is the tab)

Also, how do I make a space between the text from each cell. At the moment it is just one long line.

Thanks

Can I Add Rows To The Flexgrid Control?
Can I add rows to the flexgrid control MSFlexGrid1 in VB6?

Flexgrid Visible Rows
I'm back. I couldn't do this job without you guys.

I have a flexgrid with 100 rows. Only 10 are visible at anytime. How do I make a particular row visible, i.e. how do I make the flexgrid scroll to a particular row. I've tried everything and nothing works.

There is a RowIsVisible command that only tells me if the row is visible or not.

Any suggestions?
Thanks.

Fixed Rows In Flexgrid
Hello everybody,


I just found out that you can use multiple fixed rows for your grid. Right now I would like to use 2 fixed rows.. 1 on top of the grid and another on the last row.

But when I set my fixedrows to 2, then my first 2 rows are always fixed.

Is it possible to do this ?


thanks,

Bjorn

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