It won't be elegant code by any means, but off the top of my head, that's the only way I can think of at the moment to accomplish this. Modify your Select query for your Data Adapter which fills the Data Table for your main table. Modify your Insert, Update and Delete commands for your Data Adapter to supply just the employee_id to your parameters collection instead of the concatenated value. Add(New Object() ) 'Data View to sort the items Dim dv As New Data View dv. Sort = "Desc" Dim cb As Data Grid View Combo Box Column = Me.
Cheers Kieran Private Sub Form2_Load(By Val sender As System.
Add(New Object() ) 'Data View to sort the items Dim dv As New Data View dv. Sort = "Des" Dim cb As Data Grid View Combo Box Column = Me.
This display value (Employee Name) is not in the underlying bound datatable as it only contains the Employee_Id which is used in the Data Grid View 'Employee Name' Cells to lookup the employee table to get the display value i.e. Hence as it stands if the user clicks to sort the 'Employee Name' column then the rows are sorted on the 'Employee_ID' which is not what is required and meaningless to the user.
The displayed data i.e., 'Employee Names' are in no meaningful sequence.
Value Member = "Val" 'Data Table to bind to Data Grid View Dim dt1 As New Data Table dt1.
The example code sorts on the column value, I need have the sorting done on the display value.
This seems like a fairly standard requirement for many applications.
Can anyone advise if this is possible and how this can be achieved.
Data Source = dt1 End Sub Run and select one of each name from the combobox in separate rows of the datgrid. All help appreciated.regards Kieran I understand your issue now. If all else fails, what I would probably end up doing would be to:1.
What I need to achieve is to have the column sorted on the column displayed value rather than the column value.
String is a class that belongs to the namespace System. String concatenation can be done using the ' ' opearator or the String. Sample code string string1 = "Today is " Date Time. Write Line(string2); String Builder String Builder is a class that belongs to the namespace System. String class, you create a new string object in memory, that requires a new allocation of space for that new object. For example, using the String Builder class can boost performance when concatenating many strings together in a loop. What is the difference between array and array list? For instance if you want to sort the values in an array then you need to do the manual operations.