CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    Geneva
    Posts
    32

    Need Help with MSFlexGrid Control

    Hello,
    I have put on a Dialog a MSFlexGrid Control.
    This Control has two columns.

    I have fill the first column with the code below,
    but I can not fill the second column

    What do I do




    VARIANT v;

    VariantInit( &v );
    v.vt = VT_I2;
    v.intVal = 1;


    while (m_pSet->IsEOF()==false)
    {
    m_ctrlGrid.SetFixedCols(0);
    m_ctrlGrid.SetFixedRows(1);
    m_ctrlGrid.SetColWidth(0,2227);
    m_ctrlGrid.SetColWidth(1,2227);

    m_ctrlGrid.AddItem(m_pSet->m_Langue ,v);

    // I will fill the second column with m_pSet->m_Description

    m_pSet->MoveNext();
    }


    Chrisitan Niquille
    Thanks for your help




  2. #2
    Guest

    Re: Need Help with MSFlexGrid Control

    I use something like this, see if it helps
    grid.SetRows(4);
    grid.SetCols(3);
    ...
    ...
    grid.SetRow(1);
    grid.SetCol(1);
    grid.SetText("Row1Col1");

    grid.SetRow(1);
    grid.SetCol(2);
    grid.SetText("Row1Col2");
    ...

    Now, I am posting a question titled "MSFlexGrid- Keyboard navigation", pls see if you can answer that.


  3. #3
    Join Date
    May 1999
    Location
    Republic of Korea
    Posts
    100

    Re: Need Help with MSFlexGrid Control

    there are other functions to put Ur data in a msflexgrid cell
    such as setrow and setcol combination with settext,
    settextmatrix, and settextarray.
    I believe msflexgrid recognize its cell data by string,
    so what i done to use additem function was that all my
    column data were converted to a string format. And added
    data strings to single string by using string format function
    and putting '\t'(tab character) between data.
    If U use tab char in additem function, it tells msflexgrid
    to put Ur data in consecutive column. So it's like bulk data
    transfer without calculating column position once row is set.

    Hope for help

    Walter


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured