I can't seem to figure out how to get a nice looking dropdownlist instead of a GridColumn EditTemplate when doing dialog editing. I want there to be a label like all of the other input fields.
Another issue is that the dropdownlist shows a blank default entry if there is no placeholder and no empty options in the datasource. My datasource currently only has 2 items, and I want the first option to be visibly selected. It is "selected" by default whether I leave the placeholder blank or not and it passes validation, but the UX here is not intuitive. All documentation I've found either doesn't not show the class of what the dropdownlist is bound to, or it's just bound to a string array which doesn't seem helpful if you need a traditional dropdownlist whose options have both a text and value field.
My datasource currently looks like this:
public RequestTypes
{
public int Id {get; set;}
public string Name {get; set;}
}
I've also tried using a Template inside of GridEditSettings and I made my own <select> HTML element by looping over my RequestTypes list and creating the options. When I made this inside the template the same issue described above exists where the dropdownlist would initially show a blank selection. I did the same thing outside of the Grid and it rendered a select HTML element appropriately. Maybe this has something to do with binding to a property which doesn't have a value yet because it's a new item? Not really sure, but other component libraries don't act like this.
I could try making my datasource a list of SelectListItem rather than a list of RequestTypes. I'm just really not sure what else to think here. If anyone has some insights, it would be much appreciated.