Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
405
Editable WebCombo in WebGrid
posted

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.

Parents
No Data
Reply
  • 19308
    posted

    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

     

Children