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

VB 6 -MSHFlexGrid

P: 49
Hi to all,

I have designed a form which contains MSFlexGrid control. Here the problem is I am getting the data into the FlexGrid from the database. But in the first column there is no data or text. But I want the serial no. in the first column like 1,2,3,4,5,6,........column wise upto data available. how to get it.

Please give me an example.

Thank u all.
Jayachandra
Sep 15 '07 #1
Share this Question
Share on Google+
9 Replies


debasisdas
Expert 5K+
P: 8,127
Instead of selecting the first column from the table select rownum ,if you are using Oracle as your backend. You will get the number from 1 to total number of records.
Sep 15 '07 #2

P: 49
Thanks for reply.

I have no Sl. No. column. in my database. Just I want to display the row numbers in the FlexGrid control. Thats it.

Thank u
Sep 17 '07 #3

hariharanmca
100+
P: 1,977
Thanks for reply.

I have no Sl. No. column. in my database. Just I want to display the row numbers in the FlexGrid control. Thats it.

Thank u
If that is not in your DB then you can use your Flixgrid Row count like

Expand|Select|Wrap|Line Numbers
  1. msfGrid.TextMatrix(1, msfGrid.Row) = msfGrid.Row
Sep 17 '07 #4

P: 3
Hi guys,

I'm sorry I didn't start a new thread but it looks like the right people are here ;o)
I use MSFlexGrid in my app where I write results from db.
Question: when I make multi selection in the grid how I can catch the selected row ids?
Thanks!
Sep 18 '07 #5

hariharanmca
100+
P: 1,977
Can you explain what you mead for row Id?
I think you are looking for selected value!

to get selected value
Expand|Select|Wrap|Line Numbers
  1. Dim strselectedInGrid as string
  2.  
  3. strselectedInGrid = MSFlexGrid.Text
Sep 19 '07 #6

P: 3
Can you explain what you mead for row Id?
I think you are looking for selected value!

to get selected value
Expand|Select|Wrap|Line Numbers
  1. Dim strselectedInGrid as string
  2.  
  3. strselectedInGrid = MSFlexGrid.Text
Thanks for the reply
Probably my question wasn't proper asked.
OK, with the list where I select some items I can do the following:

For i=0 to MyList.ListCount-1
if MyList.Selected(i)=True Then
...............................................
End If
Next i

I wanna do the same with the MSFlexGrid
But it doesn't have the same property as the list does.
How I can get MyGrid.Row of the selected rows?

I'd appreciate any input.
Thanks!
Sep 19 '07 #7

hariharanmca
100+
P: 1,977
In MS flex grid we have Merge cells option trough column and row. So you cannot multi select option in this grid.
Can you explain your problem why you want do that in MSFlxGrd. There is another options like list view and list box controls.
Sep 20 '07 #8

P: 3
In MS flex grid we have Merge cells option trough column and row. So you cannot multi select option in this grid.
Can you explain your problem why you want do that in MSFlxGrd. There is another options like list view and list box controls.
I wrote a procedure which fills out the grid with db-results.
Sometime I need to delete multiple objects - I wanted to select them in the grid to avoid multi clicking on delete button ;o)
It looks like MSFlexGrid doesn't have this luxury

Thanks!
Sep 24 '07 #9

hariharanmca
100+
P: 1,977
I wrote a procedure which fills out the grid with db-results.
Sometime I need to delete multiple objects - I wanted to select them in the grid to avoid multi clicking on delete button ;o)
It looks like MSFlexGrid doesn't have this luxury

Thanks!
Can you explain in which format you are going to delete. for the above procedure you have to use Listview control.

I you are deleting from Database then you have to execute the delete query and refill the grid with select query.
Sep 25 '07 #10

Post your reply

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