By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,543 Members | 2,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,543 IT Pros & Developers. It's quick & easy.

Double Click on MSHFlexgrid to show data

P: 39
Hi all,
I have a MSHFlexgrid to show my database and some textboxes to show datas I choosed from MSHFlexgrid.

I would like to know if there's a way to show a specific data I choosed from MSHF in my textbox by double-clicking the data in MSHF.

I know these script:

Expand|Select|Wrap|Line Numbers
  1. Private Sub DGrid DblClick()
  2.      With DGrid
  3.           Text1.Text = .Columns(0).Text
  4.           Text2.Text = .Columns((1).Text
  5.      End With
  6. End Sub
The problem is, those codes only work on DataGrid, but not in MSHFlexgrid.

Please help me. Thank you very much!

Nairda
Aug 10 '07 #1
Share this Question
Share on Google+
4 Replies


P: 82
Hi all,
I have a MSHFlexgrid to show my database and some textboxes to show datas I choosed from MSHFlexgrid.

I would like to know if there's a way to show a specific data I choosed from MSHF in my textbox by double-clicking the data in MSHF.

I know these script:

Expand|Select|Wrap|Line Numbers
  1. Private Sub DGrid DblClick()
  2.      With DGrid
  3.           Text1.Text = .Columns(0).Text
  4.           Text2.Text = .Columns((1).Text
  5.      End With
  6. End Sub
The problem is, those codes only work on DataGrid, but not in MSHFlexgrid.

Please help me. Thank you very much!

Nairda
Hi -

In FlexGrid, you may use the TextMatrix property.
Expand|Select|Wrap|Line Numbers
  1.      Private Sub MSHFlexgrid1_DblClick()
  2.           With MSHFlexgrid1
  3.                   Text1.Text = .TextMatrix(1, 0)   ' Row, Col
  4.                   Text2.Text = .TextMatrix(1, 1)   ' Row, Col
  5.           End With
  6.      End Sub
  7.  
Aug 10 '07 #2

P: 39
Hi -

In FlexGrid, you may use the TextMatrix property.
Expand|Select|Wrap|Line Numbers
  1.      Private Sub MSHFlexgrid1_DblClick()
  2.           With MSHFlexgrid1
  3.                   Text1.Text = .TextMatrix(1, 0)   ' Row, Col
  4.                   Text2.Text = .TextMatrix(1, 1)   ' Row, Col
  5.           End With
  6.      End Sub
  7.  
Thank you very much,

But, no can't do.
TextMatrix only retrieve a specific cell.
Example: TextMatrix (1,0) only retrieve cell (1,0) of the MSHF, But it can't be used if I choosed / double-clicked random cell in my MSHF. It'll be showing the same data each time I double-clicked the MSHF

I want to display entire data in the same row when I double-clicked any cell in My MSHF. Example: I double-clicked cell (4,0) in MSHF, It'll show cell (4,0) data in Textbox1, cell (4,1) data in Textbox2, and so on.

Anything else there?

Nairda
Aug 10 '07 #3

P: 82
Thank you very much,

But, no can't do.
TextMatrix only retrieve a specific cell.
Example: TextMatrix (1,0) only retrieve cell (1,0) of the MSHF, But it can't be used if I choosed / double-clicked random cell in my MSHF. It'll be showing the same data each time I double-clicked the MSHF

I want to display entire data in the same row when I double-clicked any cell in My MSHF. Example: I double-clicked cell (4,0) in MSHF, It'll show cell (4,0) data in Textbox1, cell (4,1) data in Textbox2, and so on.

Anything else there?

Nairda
Alright. Maybe you can try this one below. If still don't work. I'll get back to you, ok?

Private Sub MSHFlexgrid1_DblClick()
With MSHFlexgrid1
Text1.Text = .TextMatrix(.Row, 0) ' Row, Col
Text2.Text = .TextMatrix(.Row, 1) ' Row, Col
End With
End Sub
Aug 10 '07 #4

hariharanmca
100+
P: 1,977
Alright. Maybe you can try this one below. If still don't work. I'll get back to you, ok?

Private Sub MSHFlexgrid1_DblClick()
With MSHFlexgrid1
Text1.Text = .TextMatrix(.Row, 0) ' Row, Col
Text2.Text = .TextMatrix(.Row, 1) ' Row, Col
End With
End Sub

Expand|Select|Wrap|Line Numbers
  1. Private Sub MSHFlexgrid1_DblClick()
  2.     With MSHFlexgrid1
  3.         Text1.Text = .TextMatrix(.Row, .Col) ' Row, Col
  4.         Text2.Text = .TextMatrix(.Row, .Col) ' Row, Col
  5.     End With
  6. End Sub
this will be select random cell selection.
Aug 10 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.