?
Solved

FlexGrid Doesn't Exhibit a TextMatrix under .NET

Posted on 2003-03-10
2
Medium Priority
?
1,168 Views
Last Modified: 2011-09-20
While trying to move to .NET, I have a situation where I want to populate a flexgrid (or Datagrid, if I *really* have to) out of a couple of hashtables ("TransCounts" and "FNames"), like so:

 Sub RefreshGrid()
        Dim iCount As Integer, FName As String, iTranCount As Integer
        Dim StrTransName As String, TransItem As DictionaryEntry

        iCount = 0
        Me.AxMSFlexGrid1.Cols = 3
        Me.AxMSFlexGrid1.FixedCols = 0
        Me.AxMSFlexGrid1.FixedRows() = 0
        Me.AxMSFlexGrid1.Rows = TransCounts.Count
        For Each TransItem In TransCounts
            iCount = iCount + 1
            StrTransName = CType(TransItem.Key, String)
            iTranCount = CType(TransItem.Value, Integer)
            FName = CType(FNames(StrTransName), String)
            AxMSFlexGrid1.Textmatrix(iCount, 1) = StrTransName
            AxMSFlexGrid1.Textmatrix(iCount, 2) = iTranCount
            AxMSFlexGrid1.Textmatrix(iCount, 3) = FName
        Next
    End Sub

And of course, VB.NET really doesn't like the TextMatrix bit of a Flexgrid, even though the Object Browser shows us:

<System.Runtime.InteropServices.DispIdAttribute(65)>
Public Property TextMatrix(ByVal Row As Integer, ByVal Col As Integer) As String
    Member of MSFlexGridLib.MSFlexGrid

under Interop.MsFlexGrid

Is there an easy way to do this..? Why does Microsoft have to make everything harder than before??
0
Comment
Question by:nchantim
[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
2 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 540 total points
ID: 8104229
Try to use .Text property instead of TextMatrix

msfg.Row =1
msfg.COl=1
msfg.Text = "Whatever"
0
 

Author Comment

by:nchantim
ID: 8105910
It does work, and I hadn't even tried that before.
Why does Microsoft have to castrate ActiveX controls though.

Just a note: I ended up using a Datagrid bound to a datable that I dynamically build from the two hashtables...
Nice and simple ;)

0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

762 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