I have a situation where I add a webcombo to a webgrid. The webgrid is bound to a list object, with the combo's DataValueField="DatabaseID" and DataTextField="DatabaseName". I can add the combo to the grid fine and everything works 100%.
My problem come in when I set the combo's Editable="true" I get the following exception when setting the EditorControlID for the column in the grid.
"WebCombo has the Editable property set to True; therefore it must have equal DataTextField and DataValueField to be used as an editor in an UltraWebGrid."
My reason for setting the combo property to true is to allow the user set the value to null. I know a way around this is to add an item to the list object with DatabaseID = 0 (something i know i can set to dbnull) and DatabaseName = "", but I don't like that as a solution.
I am primarily a windows form developer, i know this can be done in a wingrid. I've also recently upgraded to Infragistics 8.2 from 73. When using 7.3 it worked fine. The problem only arose after the upgrade.
Support was added in 2008 Volume 2 to allow the WebCombo to accept "user defined values" when used inside of the grid as an editor. In the past, you had to choose a value that was included in the WebCombo. If the user tried to type in a value free form, the value would get "lost". It sounds like the new feature added for 2008.2, closed a loophole that you were previously taking advantage of. I'll alert the developers and see if there's a "best of both worlds" solution. Otherwise, your workaround is going to have to be to add a "null" or "notset" member to your list. You can do this manually after the combo is databound, which wouldn't require you to change your underlying table structure..
-Tony
we use a editable grid with editable comboboxes and run in the same issue after upgrade from 2008.1 to 2008.2 the combobox is set editable because we use the .selectWhere(...) AJAX Javascript method for filtering the list by typing in the combobox. We won't change that behavior.
Example:cmbXY.DataValueField = "id"; // id is a GuidcmbXY.DataTextField = "name";Grid.Columns[5].AllowUpdate = AllowUpdate.Yes;Grid.Columns[5].Type = ColumnType.DropDownList;Grid.Columns[5].ValueList.WebCombo = cmbXYType; // The Error happens here: "WebCombo has the Editable property set to True; therefore it must have equal DataTextField and DataValueField to be used as an editor in an UltraWebGrid."
When i try to set the DataValueField the same as the DataTextField (cmbXY.DataValueField = "name"; cmbXY.DataTextField = "name";) then i get no error, but that is no solution because i loose the internal GUID an i have to redesign my application
WORKAROUND as you talking about in the posts before:
I tried cmbXY.rows.add() and also extending my Dataset with a null row an playing around with it for hours but until now i cannot get a workaround working. May you explain more detailed or can you made a example how to add a "null" or "notset" member to the list.or is it possible to deactivate that new feature, because we hat no problems with the old behavior. At the moment we went back to 2008.1
Thank's a lot for a solution
regards Willi
Willi,
The workaround it so set Editbale to false on the WebCombo, and to add the empty "null" value to your list. Just be sure to add the row to the combo after the combo is databound, otherwise the row will get replaced. Also, I'd recommend using the EditorControlID property to attach the webcombo rather than the ValueList.
{
}
<ig:UltraWebGrid runat="server" ID="grid2" Browser="Xml" DataSourceID="SqlDataSource1"
<Bands>
<ig:UltraGridColumn BaseColumnName="ProductID" DataType="System.Int32" IsBound="True"
</ig:UltraGridColumn>
<ig:UltraGridColumn BaseColumnName="CategoryID" DataType="System.Int32" EditorControlID="combo1"
</ig:UltraGridBand>
<DisplayLayout Name="grid2" AllowUpdateDefault="Yes" BorderCollapseDefault="Separate"
</DisplayLayout>
<ig:WebCombo runat="server" ID="combo1" DataSourceID="SqlDataSource2" DataTextField="CategoryName"
<ig:UltraGridColumn IsBound="True" BaseColumnName="CategoryID" DataType="System.Int32"
<Header Caption="CategoryID">
<DropDownLayout BorderCollapse="Separate" RowHeightDefault="20px" Version="4.00"
</DropDownLayout>
Hi,
I also upgraded my project from Infragistics V7.1 to V8.2 Vol 2 and facing the same problem. I tried the same solution recomended in the databound method. It not even compling. If any one know the working solution could you please help me get rid of this problem.
Regards
Senthil
The fix is coming up at the end of March. Sorry for the troubles and thank you for your patience.
I have the same problem too. I'm also using 2008 v3. Is there any quick way to resolve this?
I have the same problem too, how did you guys fix this one? We upgraded the controls from 2007 v1 to 2008 v3.
Don Almeida
I have the same problem - I need to give a possibility for my client to choose value from list (webcombo) or imput his own data to ultra grid column . So WebCombo is an external imput contol for custom column. It is very important for him so I would like to know if this error is going to be repaired soon ?? Or meybe it is another solution for sach a situation??