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

How to enter data into VSFlexGrid at runtime

100+
P: 123
Hi,

Can anyone tell me how to enter data into VSFlexGrid at runtime? Kindly send me coding of that.
Mar 29 '07 #1
Share this Question
Share on Google+
11 Replies


iburyak
Expert 100+
P: 1,017
The following code will fill the first 5 rows 4 columns block of cells with numbers from 1 through 20.


[PHP]Private Sub VSFlexGrid1_Click()
With Me.VSFlexGrid1
For i = 1 To 5
For j = 1 To 4
.Row = i
.Col = j
.Cell(flexcpText, i, j) = (i - 1) * 4 + j
Next j
Next i
End With
End Sub[/PHP]
Mar 29 '07 #3

pureenhanoi
100+
P: 175
Hi,

Can anyone tell me how to enter data into VSFlexGrid at runtime? Kindly send me coding of that.
I don't know which version of VSFlexGrid you have. But i usually use VSFlexGrid Pro 7.0.
To enter data into VSFlexGrid, you should set EditAble property to 1-flexEDKbd or 2-flexEDKbdMouse.
If that property = 2, you can click mouse on cell, and then enter data.
To enter data by code, you can use TextMatrix(row,col) method
example: VSFlexGrid1.TextMatrix(1,1) = "your data". Remember add at least one row and one col to enable enter data
Mar 29 '07 #4

100+
P: 123
I don't know which version of VSFlexGrid you have. But i usually use VSFlexGrid Pro 7.0.
To enter data into VSFlexGrid, you should set EditAble property to 1-flexEDKbd or 2-flexEDKbdMouse.
If that property = 2, you can click mouse on cell, and then enter data.
To enter data by code, you can use TextMatrix(row,col) method
example: VSFlexGrid1.TextMatrix(1,1) = "your data". Remember add at least one row and one col to enable enter data

Thanks. Now I am able to enter data in VSFlexGrid. After entering data into Grid, I want to save entered data into table. How to do coding of that? Kindly send me coding
Mar 29 '07 #5

vijaydiwakar
100+
P: 579
Thanks. Now I am able to enter data in VSFlexGrid. After entering data into Grid, I want to save entered data into table. How to do coding of that? Kindly send me coding
drive to loops one for row and another for col
adjust the qry
and execute it
Mar 29 '07 #6

pureenhanoi
100+
P: 175
Thanks. Now I am able to enter data in VSFlexGrid. After entering data into Grid, I want to save entered data into table. How to do coding of that? Kindly send me coding
what kind of table will you save your data.
Mar 29 '07 #7

vijaydiwakar
100+
P: 579
Expand|Select|Wrap|Line Numbers
  1.  
  2. conn.begintrans
  3. with Flex
  4. for i=.fixedrows to .rows-1
  5. ssql="Insert into <tblname> (<filed1>,<Filed2>) values (
  6. for j=.fixedcols to .cols-1
  7. ssql=ssql & .textmatrix(i,j) & "" 
  8. if j<>.cols-1 then ssql=ssql & " , "  
  9. next
  10. ssql=ssql & " )"
  11. conn.execute ssql
  12. next
  13. end with
  14. conn.committrans
  15.  
like it
Try it
Good Luck
Mar 29 '07 #8

Expert 5K+
P: 8,434
Just a note to let you know, I've changed the title of the thread to something more appropriate than "help me soon".

MODERATOR
Mar 29 '07 #9

vijaydiwakar
100+
P: 579
've u tryed the code?
Mar 29 '07 #10

100+
P: 123
've u tryed the code?

I am able to enter data by setting its Editable property. Now listen my problem carefully.

I have kept only one row in grid at runtime. Now after entering one record, i want new row to be added dynamically so i can enter more data. How to do that? Plz let me know.
Mar 29 '07 #11

vijaydiwakar
100+
P: 579
I am able to enter data by setting its Editable property. Now listen my problem carefully.

I have kept only one row in grid at runtime. Now after entering one record, i want new row to be added dynamically so i can enter more data. How to do that? Plz let me know.
Now listen carefully
use flex.rows=flex.rows+1
for that
Mar 29 '07 #12

Post your reply

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