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
1070
Creating a WebCombo in a cell
posted

 I'm using the following code to create a WebCombo in a cell of my grid and it's not working. Nothing is displayed in the cell when editing. I think the only difference between my code and the example from the docs is that my combo is created in code instead of being defined on the aspx page. Here is my code, does anyone know why this doesn't work?

void employeeGrid_InitializeLayout(object sender, LayoutEventArgs e)
    {
        WebCombo crewTypeList = new WebCombo();
        crewTypeList.DataTextField = CrewTypeFields.CrewType.Name;
        crewTypeList.DataValueField = CrewTypeFields.CrewTypeId.Name;
        crewTypeList.DataSource = ServiceManager.GetEmployeeManager().GetCrewTypes();
        crewTypeList.DataBind();

        e.Layout.Bands[0].Columns.FromKey("CrewType").EditorControlID = crewTypeList.UniqueID;
        e.Layout.Bands[0].Columns.FromKey("CrewType").ValueList.DisplayStyle = ValueListDisplayStyle.DisplayText;
    }