Editing data using DevExpress


Author
Message
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I am using DevExpress Grid for data entry. I am using BindingBusinessSource for data binding.

My question, how could I have additional column that show product description, for example after select product code?

Thank you

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Include it in your SQL query or create a custom field.  I recommend the custom field which returns the description.  You can use a scalar method to pull the description from a FK table.  When you create a custom field, the BO treats it as though it belongs to that table.  You can see how to do this in the docs or the CRM sample for examples of how to achieve this.
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
You can use a scalar method to pull the description from a FK table.




Hi,

Do you meant to use ADO.NET code directly to retrieve the FK desciption?



Thank you
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
No.  You can create custom properties to a business object.  If you look at the tutorial documentation it shows you how to do this:

Application Framework -> Getting Started -> Creating a WinForms App -> Adding Custom Field Properties

You can then make this a Readonly property and then execute a scalar query to retrieve the data:

Public Readonly Property MyCustomProperty As String
    Get
        '-- Establish Locals
        Dim loCommand As New SqlCommand()
        loCommand.CommandText = "SELECT MyDescriptionField FROM MyTable WHERE MyFK=@MyFK")
        loCommand.Parameters.Add("@MyFK",SqlDataType.Int)
        loCommand.Parameters("@MyFK").Value = Me.MyFKField
        Return CType(Me.ExecuteScalar(loCommand), String)
    End Get
End Property

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search