FlexGrid (Winforms VB.NET) Populate databound fields on edit

Posted by: mwebster on 29 November 2020, 3:21 pm EST

    • Post Options:
    • Link

    Posted 29 November 2020, 3:21 pm EST

    I have an application (VB, winforms) that uses the FlexGrid. Users are able to insert and edit rows in the FlexGrid. Some of the fields are databound drop down lists. I am using the “AfterEdit” event to detect a change to a drop down list and I am trying to then populate one of the other databound colums with text depending on which option was selected from the list. For example:

        If Not IsDBNull(fgQuoteDetails.Rows(e.Row).Item("PartCategoryID")) Then
            fgQuoteDetails.Rows(e.Row).Item("Description") = GeneratePartNo(e.Row).Item("PartCategoryID"))
        End If
    

    The problem is that the code executes but does exactly nothing. In fact, I can use the same event and try to set the value of any of the bound columns to “Test” and the code executes but is completely ignored and no value is ever set into the column.

    I just need to know how I can set a value of a databound column in code at runtime.

  • Posted 1 December 2020, 7:15 am EST

    Hi,

    I can’t replicate the issue at my end, please refer to the sample attached, which changes the Product Name when SupplierID is changed, SupplierID has DropDownList created by DataMap. If you are doing something else, please provide us with a sample so that we can help you better.

    Regards,

    Prabhat Sharma.

    FGPopulate.zip

  • Posted 1 December 2020, 10:13 am EST

    This is actually no longer an issue. I ended up doing it another way.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels