473,503 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MSFlex Grid Control - Fixed Rows

Hello,

I am using the MSFlexGrd Control in VB5. I have 1 fixed row and one fixed
column. I am trying to do a sort when the user clicks a column in the FIXED
ROW. But when I capture the row number in the click event I get row = 1 if I
click on the FIXED row OR the actual row 1. How can I get the grid control
to tell me when the user has clicked on the FIXED row and not on row 1
(since they both produce row = 1 and I cannot tell them apart when it does
this)?

Thank you.
Otis
Mar 8 '06 #1
4 11164
????

You say you want to sort when the user clicks a column in the fixed row
(which is the row across the top of the control), then go on to say you are
capturing the row number in the click event which will always be (correctly)
1 because clicking the header selects the entire column and moves the focus
rectangle to the first work row (the row 1 you mention).

If you want to determine the column clicked when a header in the top fixed
row is clicked, all you need is:

Private Sub MSFlexGrid1_MouseDown(...
If MSFlexGrid1.Row = 1 Then
Debug.Print MSFlexGrid1.Col
End If
End Sub
Similarly the reverse holds true for detecting the row clicks when the row
fixed header is clicked:

Private Sub MSFlexGrid1_MouseDown(...
If MSFlexGrid1.Col= 1 Then
Debug.Print MSFlexGrid1.Row
End If
End Sub

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.


"Otie" <ot*********@adelphia.net> wrote in message
news:SI********************@adelphia.com...
Hello,

I am using the MSFlexGrd Control in VB5. I have 1 fixed row and one fixed
column. I am trying to do a sort when the user clicks a column in the FIXED
ROW. But when I capture the row number in the click event I get row = 1 if I
click on the FIXED row OR the actual row 1. How can I get the grid control
to tell me when the user has clicked on the FIXED row and not on row 1
(since they both produce row = 1 and I cannot tell them apart when it does
this)?

Thank you.
Otis
Mar 9 '06 #2
You can also use the MouseRow and MouseCol properties.

Rick

"Randy Birch" <rg************@mvps.org> wrote in message
news:44**********************@news.astraweb.com...
????

You say you want to sort when the user clicks a column in the fixed row
(which is the row across the top of the control), then go on to say you are capturing the row number in the click event which will always be (correctly) 1 because clicking the header selects the entire column and moves the focus rectangle to the first work row (the row 1 you mention).

If you want to determine the column clicked when a header in the top fixed
row is clicked, all you need is:

Private Sub MSFlexGrid1_MouseDown(...
If MSFlexGrid1.Row = 1 Then
Debug.Print MSFlexGrid1.Col
End If
End Sub
Similarly the reverse holds true for detecting the row clicks when the row
fixed header is clicked:

Private Sub MSFlexGrid1_MouseDown(...
If MSFlexGrid1.Col= 1 Then
Debug.Print MSFlexGrid1.Row
End If
End Sub

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.


"Otie" <ot*********@adelphia.net> wrote in message
news:SI********************@adelphia.com...
Hello,

I am using the MSFlexGrd Control in VB5. I have 1 fixed row and one fixed
column. I am trying to do a sort when the user clicks a column in the FIXED ROW. But when I capture the row number in the click event I get row = 1 if I click on the FIXED row OR the actual row 1. How can I get the grid control
to tell me when the user has clicked on the FIXED row and not on row 1
(since they both produce row = 1 and I cannot tell them apart when it does
this)?

Thank you.
Otis

Mar 9 '06 #3
I think you misunderstand.

When I click on column 9 in the fixed row, VB returns row = 1. I want this
click to do a sort on the data in column 9.
But when I click on the CELL in column 9, row 1, or any row, I want to take
that cell value and store it somewhere.
The problem with VB is that if you click on any column in a fixed row it
returns the row number as if you had clicked on the actual row 1, not in the
fixed row. These different clicks (one on the fixed row, column 9 and the
other on the actual row 1 [non-fixed row], column 9) HAVE TO be detected
differently or else I am screwed (I won't be able to detect when the user
wants to sort versus when he wants to capture cell contents.

I hope I am more clear here.

I will try Rick's suggestion about MouseRow.

Thank you.

--

Otis

"Randy Birch" <rg************@mvps.org> wrote in message
news:44**********************@news.astraweb.com...
????

You say you want to sort when the user clicks a column in the fixed row
(which is the row across the top of the control), then go on to say you
are
capturing the row number in the click event which will always be
(correctly)
1 because clicking the header selects the entire column and moves the
focus
rectangle to the first work row (the row 1 you mention).

If you want to determine the column clicked when a header in the top fixed
row is clicked, all you need is:

Private Sub MSFlexGrid1_MouseDown(...
If MSFlexGrid1.Row = 1 Then
Debug.Print MSFlexGrid1.Col
End If
End Sub
Similarly the reverse holds true for detecting the row clicks when the row
fixed header is clicked:

Private Sub MSFlexGrid1_MouseDown(...
If MSFlexGrid1.Col= 1 Then
Debug.Print MSFlexGrid1.Row
End If
End Sub

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.


"Otie" <ot*********@adelphia.net> wrote in message
news:SI********************@adelphia.com...
Hello,

I am using the MSFlexGrd Control in VB5. I have 1 fixed row and one fixed
column. I am trying to do a sort when the user clicks a column in the
FIXED
ROW. But when I capture the row number in the click event I get row = 1 if
I
click on the FIXED row OR the actual row 1. How can I get the grid control
to tell me when the user has clicked on the FIXED row and not on row 1
(since they both produce row = 1 and I cannot tell them apart when it does
this)?

Thank you.
Otis

Mar 9 '06 #4
From VB Help (don't know why I didn't see this - have used the grid control
for years - yikes!):
MouseCol, MouseRow Properties

Remarks

Use these properties programmatically to determine the mouse location. These
properties are useful in displaying context-sensitive help for individual
cells and testing whether the user has clicked on a fixed row or column.

This looks like the way to do it.

Thank you so much.


--
Otis

"Rick Rothstein [MVP - Visual Basic]" <ri************@NOSPAMcomcast.net>
wrote in message news:Vp********************@comcast.com...
You can also use the MouseRow and MouseCol properties.

Rick

"Randy Birch" <rg************@mvps.org> wrote in message
news:44**********************@news.astraweb.com...
????

You say you want to sort when the user clicks a column in the fixed row
(which is the row across the top of the control), then go on to say you

are
capturing the row number in the click event which will always be

(correctly)
1 because clicking the header selects the entire column and moves the

focus
rectangle to the first work row (the row 1 you mention).

If you want to determine the column clicked when a header in the top
fixed
row is clicked, all you need is:

Private Sub MSFlexGrid1_MouseDown(...
If MSFlexGrid1.Row = 1 Then
Debug.Print MSFlexGrid1.Col
End If
End Sub
Similarly the reverse holds true for detecting the row clicks when the
row
fixed header is clicked:

Private Sub MSFlexGrid1_MouseDown(...
If MSFlexGrid1.Col= 1 Then
Debug.Print MSFlexGrid1.Row
End If
End Sub

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.


"Otie" <ot*********@adelphia.net> wrote in message
news:SI********************@adelphia.com...
Hello,

I am using the MSFlexGrd Control in VB5. I have 1 fixed row and one fixed
column. I am trying to do a sort when the user clicks a column in the

FIXED
ROW. But when I capture the row number in the click event I get row = 1
if

I
click on the FIXED row OR the actual row 1. How can I get the grid
control
to tell me when the user has clicked on the FIXED row and not on row 1
(since they both produce row = 1 and I cannot tell them apart when it
does
this)?

Thank you.
Otis


Mar 9 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1513
by: Chad | last post by:
for ease of use, and for features such as resizable columns, edit in place, horiz and vertical scrolling, heirarchy display, etc?
2
1845
by: Tom | last post by:
I need to display a series of controls (in my case, a custom control) in a grid-like fashion. This means this particular control would be repeated multiple times, arranged in a row/column format....
117
18409
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
0
2212
by: romancoelho | last post by:
Hey everyone, I know this has to be simple, but can't figure out how to do it. How can I display the grid lines in all rows in the gird. The default behavior of the DataGridView seems to be that it...
1
422
by: sonali_aurangabadkar | last post by:
i want to edit whole grid on singel button click
0
943
by: Pramuditha | last post by:
can i sort a msflex control column while there is a column header? how?
1
991
by: firozfasilan | last post by:
How Can we Print(Hard copy) the Contents of a MSFlex Grid control Please Explain with the help of code i am waiting
0
1020
Ali Rizwan
by: Ali Rizwan | last post by:
Hello Everybody I want to take the print of only MSFlex grid instead of whole page. How can i do this? And How can i adjust the quality of print and size? My flexgrid has 40-50 rows and 6 columns...
6
7962
by: Romulo NF | last post by:
Greetings again to everyone, Im back to show this grid componenet i´ve developed. With this grid you can show the data like a normal table, remove the rows that you need, add rows, import data,...
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.