Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Editable Flex Grid

Posted on 2004-09-26
6
Medium Priority
?
1,563 Views
Last Modified: 2013-12-26
1) How to make Flex Grid or Data Grid editable in vb6.Do we have any other editable grid control in vb6.
2) how to embed Excel sheet on any VB form.
0
Comment
Question by:deepu712
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 26

Expert Comment

by:Rejojohny
ID: 12157879
1) flexgrid cannot be editable .. the other grid provided by microsoft is datagrid
2) what do u mean by embed .. do u just want to open and display an excel sheet .. u could look at OLE or reference to Excel objects within ur project and use them to open an excel application and ur workbook
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 12157918
have a look at this link provided by microsoft .. shows how u could code to make ur flexgrid editable ...
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/KB/ARTICLES/Q85/1/09.asp&NoWebContent=1

there are also some third party controls like sharpgrid, spread control, VSFlexgrid, shridian controls etc which provide good functionalities .. like the one u require and also adding combos, checkbox within cells etc ..
0
 
LVL 11

Accepted Solution

by:
dbrckovi earned 500 total points
ID: 12163054
FlexGrid is not editable by default, but you can use KeyPress event to make it editable.

For example:

'---------------------------------------------------
Private Sub Form_Load()
    MSFlexGrid1.Rows = 5
    MSFlexGrid1.Cols = 5
End Sub

Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
    With MSFlexGrid1
        Print KeyAscii
   
        If KeyAscii = 8 And Len(.Text) > 0 Then .Text = Left(.Text, Len(.Text) - 1)
       
        If KeyAscii >= 32 And KeyAscii <= 128 Then
            .Text = .Text & Chr(KeyAscii)
        End If
    End With
End Sub
'------------------------------------------------------------
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 11

Expert Comment

by:Steiner
ID: 12190636
Cool thing dbrckovi, I never thought that making a flexgrid editable would be that easy...
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12192624
Well yes, it's easy to create basic edit functions, but some things are still not possible as far as I know.

For example, I never managed to create blinking cursor, or find an easy way to edit middle of the text in a cell.

Another possibility would be to do the Excell-style editing. For example, create a textbox next to the flexgrid and keep it updated with the contents of the selected cell.
In textbox's Change event, update the selected cell.

'-------------------------------------

To embed an excell sheet on your form just create WebBrowser control (Project -> Components -> Microsoft Internet Controls)
and use it's Navigate function:

WebBrowser1.Navigate "d:\download\rosenthal.xls"
0
 
LVL 9

Expert Comment

by:dancebert
ID: 12201440
Many developers have written wrappers or templates for flexgrid to make it editable.  This is the one I use.  It's object-oriented and allows input validation on a column-by-column basis.

http://www.a1vbcode.com/app.asp?ID=2281
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question