Hi,
I am using the UltraWingrid, I have a wincombo as an editor inside the grid.
I don't have a problem when the Wincombo is selecting one value. If I implement multiple values as shown in
http://help.infragistics.com/NetAdvantage/WinForms/2011.2/CLR2.0/?page=WinCombo_Selecting_Multiple_Values_within_WinCombo.html
and I try to update I get the following error:
Unable to update the data value: Value in the editor is not valid
I have put a breakpoint on almost all the eventssuch as BeforeExitEditMode and afterExitEditMode and the values seems correct, the combination of all the selected values.
Please advise this seems an error in the grid since it accepts and update a single value correctly.
Jayson.
Hi Jayson,
What's the DataType of the grid column? It needs to be an object array.
Hi Mike,
Thanks for the reply, the datatype is a string, I am retrieving it from the database. I tried using an unbound column and setting its datatype to an object array, however I am not able to assign the column values to the value from the database.
Is there an example on how to implement the solution?
Thanks, Jayson.
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
Hi Boris,
I left this issue a while ago and now it is coming back to be one of the requirements. I have looked at the forms and I can't find an exact answer. I have also updated to the latest version 11.2.20112.2135 and I am getting the same issue.
You can build a sample so easy by adding a grid and an ultracomboeditor:
Enclosed please find the code, you can copy it and paste it:
Public Class Form1
Private MakeOrdersDataTable As DataTable
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'TEST_DBDataSet.Book1' table. You can move, or remove it, as needed. UltraComboEditor1.DataSource = MakeCustomerDataTable() UltraComboEditor1.CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox UltraComboEditor1.CheckedListSettings.CheckBoxAlignment = ContentAlignment.MiddleRight UltraComboEditor1.CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItems UltraComboEditor1.CheckedListSettings.ListSeparator = ", " UltraComboEditor1.CheckedListSettings.ItemCheckArea = Infragistics.Win.ItemCheckArea.CheckBox
End Sub
Private Sub UltraButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UltraButton2.Click Dim dataSet As New DataSet() dataSet.Tables.Add(MakeCustomersDataTable) Me.UltraGrid1.DataSource = dataSet
Private Function MakeCustomersDataTable() As DataTable ' Declare a DataTable to contain the program generated data Dim dataTable As New DataTable("Customers")
Dim colWork As New DataColumn("CustomerID", GetType(Int32)) dataTable.Columns.Add(colWork)
' Add CustomerID column to key array and bind to DataTable Dim Keys(0) As DataColumn Keys(0) = colWork dataTable.PrimaryKey = Keys
' Create and add a CustomerName column colWork = New DataColumn("CustomerName", GetType(Object)) ' colWork.MaxLength = 50 dataTable.Columns.Add(colWork)
' Create and add a LastOrderDate column colWork = New DataColumn("LastOrderDate", GetType(Date)) dataTable.Columns.Add(colWork)
' Add a row Dim row As DataRow = dataTable.NewRow() row("CustomerID") = 1 row("CustomerName") = "John" row("LastOrderDate") = Now dataTable.Rows.Add(row)
' Add another row row = dataTable.NewRow() row("CustomerID") = 2 row("CustomerName") = "Fred" row("LastOrderDate") = Now.AddDays(-101) dataTable.Rows.Add(row)
Return dataTable End Function
Private Function MakeCustomerDataTable() As DataTable ' Declare a DataTable to contain the program generated data Dim dataTable As New DataTable("Customer")
Dim colWork As New DataColumn("CustomerName", GetType(String)) colWork.MaxLength = 50 dataTable.Columns.Add(colWork) Dim row As DataRow = dataTable.NewRow()
row("CustomerName") = "John"
dataTable.Rows.Add(row)
row = dataTable.NewRow()
row("CustomerName") = "Fred"
Private Sub UltraGrid1_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
e.Layout.Bands(0).Columns("CustomerName").EditorComponent = UltraComboEditor1 e.Layout.Bands(0).Columns("CustomerName").Style = UltraWinGrid.ColumnStyle.DropDownList e.Layout.Bands(0).Columns("CustomerName").CellActivation = Activation.AllowEdit
End SubEnd Class
When you run the sample:
1) Click on Ultrabutton1 the grid will be poulated.
2) In the Grid CustomerName cfiled lick on the dropdown and choose 2 values John and Fred.
3) Click on the Ultrabutton again and you will get the error message.
If you want I can attach the sample.
Thanks, Magued
Hi Magued,
I can't get your code to compile. Can you put together a small sample project and attach it to your post?
Enclosed please find a sample that recreates the issue.
Thanks for the follow up and please send me regarding any questions.
I ran your sample and I reproduced the error. The problem is caused by the fact that you are setting the Style of the column to DropDownList. So you can simply remove that line of code and it works fine.
Why that line of code causes a problem is puzzling, though. I can't see any reason why that should not be a valid thing to do. It might be a bug, so I'm going to ask Infragistics Developer Support to create a case for you and write this up for developer review.
Hi Sunil,
This error message seems pretty self-explanatory. There's a MaxLength applied to either the grid column or the data source and that value you are trying to apply is too long.
I am also getting error as below while updating value in the ultragrid.
"Unable to update the row:Cannot set column 'code_company'. The value violates the MaxLength limit of this column."
I have attached screen shot as well for the same.
I am using ColumnStyle as DropDownList.
Can you please help me in this how can I fix this issue?
Thanks,Sunil
The last issue in the thread was logged as development issue 157991: When setting column style to "DropDownList" and selecting two values produces an error "Unable to update the data value: Value in the editor is not valid".
This was resolved in the January 2014 Service release so if you are using a version from before then you will want to upgrade. If you are using a current version, you should submit the issue in a new thread with more details so we can look into this.
I am getting the same problem, which is solved if I get rid of the line setting the style to DropDownList.
Is this a bug which has still not been resolved?
My problem is that I want to set the style to DropDownList because I don't want users to be able to enter values not in the drop down list.
Thank you!