?
Solved

Editable Flex Grid

Posted on 2004-09-26
6
Medium Priority
?
1,545 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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
Course of the Month8 days, 18 hours left to enroll

765 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