Results 1 to 4 of 4

Thread: Set a value in a DataGrid cell

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Europe
    Posts
    56

    Set a value in a DataGrid cell

    I work in VB6 with a DataGrid control. I try to validate data in a BeforeColUpdate event of DataGrid. When the value is wrong I want to correct the value. I use the folowing statement, like in VB Help documentation:
    DataGrid1.Columns(ColIndex).Value=correct_value
    but this statement doesn't work - it does nothing, the old value remains.
    How can I set a value in a DataGrid column ?

  2. #2
    Lively Member muralidhary's Avatar
    Join Date
    Aug 2001
    Location
    Chennai
    Posts
    89

    hi

    i have not ever did this but anyway u use this and check

    datagrid1.coloumns.item(index of ur item).text= correct_value

    bye
    ENJOY

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Europe
    Posts
    56

    Answer

    I have got the answer.
    The value setting have to be done in the After corresponding events, not in before.
    Thanks, anyway!

  4. #4
    New Member
    Join Date
    Feb 2025
    Posts
    4

    Re: hi

    Quote Originally Posted by muralidhary View Post
    i have not ever did this but anyway u use this and check

    datagrid1.coloumns.item(index of ur item).text= correct_value

    bye
    Yes indeed... Thank you... (VB6 ROCKS! )

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