Again, note that other than necessary changes such as EnableEmbeddedSkins from true to false, I made NO changes anywhere else in my *.aspx or any changes in my code-behind. Also, note that all my GridDropDownColumns worked just fine with the original "Telerik" skin and EnableEmbeddedSkins="true", but one stopped working when I switched to the new custom skin "NewTelerik" and EnableEmbeddedSkins="false". And again, I have not yet made any substantive changes to the css file, so there's something funny here. A bug?
I tracked the difference between the GridDropDownColumns that work with both original and new skins and those that work only with the original skin to DropDownControlType. So GridDropDownColumns with DropDownControlType="RadComboBox" only work with the built-in skin "Telerik" and not with the custom skin "NewTelerik" even though there have not been any style changes in the css style file.
8 Answers, 1 is accepted
I've been able to get all the GridDropDownColumns to work with the new custom skin by setting the DropDownControlType for all of them to DropDownList.
On a related matter to these dropdownlists, I have NOT been able to get a default value set for a new insert item. I have used the technique explained near the bottom of
but without success. Using that technique (predefined values via System.Collections.Specialized.ListDictionary passed to InsertItem), I am able to set defaults for textboxes, for checkboxes, but not for the DropDownLists.
Basically, the approach with the predefined values for dropdown list on init insert should be applicable as well. Have you tested the codeless solution with empty dropdown item and AppendDataBoundItems = true? It should be more straight-forward and will save you extra coding inside the ItemCommand handler.
the Telerik team
Again, look at "ProductID" being used for both DataTextField and DataValueField. A better scenario and more realistic scenario is when the DataValueField is an integer code and the DataTextField is a string name. I believe this is why there are issues throughout the Telerik controls related to DropDownLists, GridTemplateColumns, and Filtering by text versus Filtering by value.
If all of the use cases, test cases, etc, were done with meaningful distinctions between DataTextField and DataValueField, then there would be better Telerik development of these controls, and easier use for Telerik customers who use these controls.
So how do you do a GridTemplateColumn for a DropDownList where you want the DataTextField to show up in the ItemTemplate and the DataValueField to be bound in the EditItemTemplate???
In the situation you depicted you merely need to change the DataTextField for the comboboxes from the edit template to retrieve the data from the ProductName column in the source (for example) and do the same for the DataBoundLiteralControl created in the item template of the column, i.e.:
The rest of the logic can remain unchanged.
the Telerik team
But it does not work correctly because the three different GridTemplateColumns do not display distinct results corresponding to the distinct DataSourceId's that are different in each of the the three GridTemplateColumns. So far, the only solution that I've been able to get to work is to modify the select statement in the DataSource for the MasterTable so that each row record returns for each column both the correct Name and Guid values for each of the columns. Then the markup for the GridTemplateColumns looks like this:
And this approach does work successfully including also being able to set appropriate initial default values in the code-behind file. The only disadvantage is that a lot of extra output has to be generated from the Select statement for the DataSource on the MasterTable. Although I have not yet integrated filtering (note that Filtering is turned off).
Again, I recommend that the Telerik team use more realistic case scenarios when developing/testing controls involving dropdownlists, filters for dropdownlists, and defaults for dropdownlists. This is the one area of the RadControls for ASP.NET that in my opinion needs the most attention for fixing what I'll call "inconveniences" or "issues" that need "work-arounds" or extra coding when it seems the capabilities should be built-in.
Thank you for your feedback - we will definitely consider improving the information in the RadGrid online resources concerning the configuration of dropdown lists inside edit templates of template columns.The presently available articles on this subject are listed below:
http://www.telerik.com/help/aspnet-ajax/grdoperationswithdropdownlistinedititemtemplate.html (template column with dropdown list editor)
http://www.telerik.com/support/kb/article/b454K-gmk-b454T-cbb.aspx (dropdown/combobox editors in template RadGrid columns)
http://www.telerik.com/help/aspnet-ajax/grdcustomizeconfiguregriddropdowncolumn.html (built-in GridDropDownColumn)
On the other hand, we will appreciate if you perform a quick test and see whether the same configuration for the dropdown list editors works in a regular MS GridView (placing the combo editors inside edite templates of template fields). Basically, the template columns of RadGrid should exhibit the same behavior as the regular GridView template columns.
Therefore, if you can attain the requested behavior without SELECT query modification for the MS control, please submit this demo project via our support ticket system and we will gladly include RadGrid implementation beside it which mimics the same behavior.
the Telerik team
If something fails in the standard Microsoft control, then what does that prove?
I thought that the whole point of paying extra money to a third-party company, Telerik, to buy third-party controls, RadGrid, was to get something that Microsoft fails to provide. So if some feature fails in Microsoft, then that is all the more reason for Telerik to provide the feature because Microsoft does not!!!!
Also, just to be careful to avoid any confusion, we should be careful to distinguish the select query for the MasterTable data source from the various select queries in the other data sources used to generate the dropdowncontrols for some of the columns of the MasterTable......
I proposed you to test the same scenario with the regular GridView control because RadGrid extends the built-in capabilities of the plain GridView by bringing various features/enhancements and at the same time making the migration process seamless. Here is the white paper providing comparison between RadControls for ASP.NET AJAX and the default Microsoft web controls in Visual Studio:
Hence if some type of functionality works as expected with MS GridView, it is very likely that it will function properly with RadGrid for ASP.NET AJAX when the object model of both products is pretty similar. I apologize if you found my last explanation/suggestion confusing or misleading in some way.
the Telerik team