Hello. I'm currently trying to upgrade a infragistics webGrid 14.2. I'm having problems getting the code below to work:
Dim EmployeeName As Infragistics.Web.UI.GridControls.ValueList = wdgAssignments.Columns(EmployeeIDColumn).ValueList EmployeeName.DataSource = UnitDataset1 EmployeeName.DataMember = "Employee" EmployeeName.ValueMember = "EmployeeId" EmployeeName.DisplayMember = "FullName" EmployeeName.DataBind()
What should I used since Type infragistic.web.ui.Gridcoontrols.Valuelist is not defined.
Hello Holsey,
Thank you for posting in the Infragistics community !
I am not sure what you are trying to achieve so it will be quite helpful if you answer my questions:
1) Are you using WebDropDown or other provider for the WebDataGrid
2) At what time/event are you trying to get .ValueList and what do you expect it to return ?
3) What is wdgASssignments in your code - is this the WebDataGrid or something else ?
Please update the thread with answers to these and I will be glad to help you.
To answer your questions (I'm a coworker of his):
1) No, it is not for a webdropdown.
2) I believe on the specific page he is trying to access it, it is in a few different locations depending on parameters the page is loaded.
3) Yes, that is the grid.
I am working on a page where I'm trying to find the alternative to this Value list as well. On my page, and similarly on his, the table is databound to a specific datasource. That datasource returns some ID fields (numberic) that actually point to a primary key in another table. We would then use another query to get those values and then update the ValueList of that column and it would select the proper value to show on the screen. This was done by previous programmers of this product and the desire is to not change the current procedures as much as possible, but to upgrade our grids from the 10.3 UltraWebGrid to the 14.2 WebDataGrid.
Specifically in my page, I am trying to update the value list after the table is databound. The column for the datasource is called RequestStatusID and it returns an Integer that points to our Lookup table. However, after the table was databound (previously), we would update the ValueList like below to make that column show the text value.
Private Sub SetupStatusColumn() Dim StatusList As ValueList = uwgRequests.Columns.FromKey("RequestStatusID").ValueList If StatusCodes Is Nothing Then Dim Lookup As New USASLookup.LookupBLL() StatusCodes = Lookup.GetData("REQUEST_STATUS") End If StatusList.DataSource = StatusCodes StatusList.DataMember = "Lookup" StatusList.ValueMember = "LOOKUPID" StatusList.DisplayMember = "VALUE" StatusList.DataBind() End Sub
This would take a value of 1298 for that cell and change it to show Pending on the grid. Is there a way to do this functionally with the WebDataGrid.
Hello,
Thank you for clarification. This can be achieved in the WebDataGrid using a WebDropDown editor provider for the given column. The ВebDropDown control provides a functionality where you can store a value in the cell, but display another user-friendlu value to the user. Basically the WebDropDown is populated from a DataTable with two fields, one serve the value and the other serve the display text.
The developer can control what to be saved and what displayed using the .TextKey and .ValueKey properties, where .TextKey will match the dataSource field containing the text and .ValueKey will match the other field containing the value.
Please refer to this article describing how to run a WebDataGrid with dropdown editor provider:
http://es.infragistics.com/help/aspnet/webdropdown_using_webdropdown_as_an_editor_provider_for_webdatagrid.html
https://www.youtube.com/watch?v=B1jg3KKEF6o
I am also attaching a sample that runs WebDataGrid and utilizes WebDropDown control as editor provider for one of it s columns. For the easiness of the sample both WebDataGrid and the WebDropDown use the same DataTable as dataSource.Almost everthing is set from code behind.
Please let me know if you have further questions on the matter.
I'm just following up to see if you need any further assistance with this issue. If so please let me know.