Sometimes, I want a dropdownlist as an editor control in a grid. Just a dropdownlist. I don't need the power of the WebCombo, and don't want the headache of the new WebDropDown, which needs a ScriptManager which throws "ambiguous" errors.
Just a simple DropDownList would be great!
So, I tried to make a custom DropDownList. It works in all ways except it won't load in the grid. Obviously I'm missing something in the IProvidesEmbeddableEditor implementation. But there is zero documentation on how to use it.
Here is my code. Can anybody help?
I see why you wouldn't have found "ValueList" in your search. Since it's built-in to WebGrid, it's not a control that can be used on its own, which is why it doesn't appear under the "Adding a Custom Editor Control" link.
Likewise, I can see the value of having a reference to ValueLists underneath that "Data" node you mention. I'll pass this feedback to our Documentation team so that we can take it into account for future versions of our help documentation. Anything we can do that makes our documentation easier to use is something we definitely want to consider.
Thanks for your feedback!
OK. First. let me eat crow and apologize. I see now what you are saying.
But let me complain some, too. The documentation is not clear about the use of a DataBound ValueList. In the Help system, I browsed thusly--
ASP.NET > Developer's Guide > Controls and Components > WebGrid > Using WebGrid
Since I was working to edit data, I saw "Data." From there, I browsed--
Data Entry and Editing > Adding a Custom Editor Control.
There is nothing in the "Data Entry and Editing" section on ValueLists.
When you suggested using a ValueList, I looked it up, and what I found indicated it was nothing more than some kind of datasource. Certainly not a stand-alone control that you could plug in as a custom Editor. Nothing in that section of Help said anything about making it part of a grid.
Now this time, after using the Search function on "ValueList," how to use it came up 3/4 of the down the search results page. I find that in order to browse to it, I had to choose "Built-In Data Editors," rather than "Data." And there I find how to use ValueLists.
Shouldn't "Built-In Data Editors" be a sub-node of "Data?"
For as rich as the Infragistics Help is, things are awfully hard to find. Also, when you get into the API reference section, that is almost completely devoid of examples.
So let me apologize for my density on this subject. But I want you to understand that the Samples don't cover anything but the extreme basic functionality, and the documentation (Help) can be as complex to use as the controls themselves.
In comparison, I can find clear explanations and examples of almost anything in the .NET Framework Help within minutes. In contrast, I have been struggling with making a WebCombo work like a simple DropDownList (and combing the IG Help system) for WEEKS, and the ValueList was right there as an option the whole time.
dhaggard said:I'm surprised the Infragistics developers haven't done this for those who just need simplicity-- a plain DropdownList as a WebGrid editor control.
Using a ValueList as a DataSource would certainly simplify databinding. Only two columns, autogenerated, and the need only to hide one.
But that would not take out all the layout settings. To use a WebCombo as a "clean" dropdownlist involves going over a dozen or more layout settings to get rid of the black box background, set the height and width of the display box. Set the height and width of the list. It can be a real pain when all you want is a simple DropdownList.
With an ASP.NET DropdownLIst, you set the datasource, set two properties (DataTextField and DataValueField), call databind and it's done.
I'm surprised the Infragistics developers haven't done this for those who just need simplicity-- a plain DropdownList as a WebGrid editor control.
The WebCombo offers a lot of power. It's a great control that has its uses. I love how you can use it as DropdownList with multiple columns, something I need regularly. But sometimes it's like using a bulldozer to plant a petunia. Big-time overkill.
For a "simple" drop-down list, you can use a ValueList.
Creating your own embeddable editor using the IProvidesEmbeddableEditor interface is not a trivial process. It requires both server-side and client-side code. The best examples we have are our controls themselves, and so the source code for our controls is the best resource (assuming that you have purchased a subscription and registered a key to get access to the source code, of course).