Monday, July 25, 2011

fill dropdown list programatically from choice column in sharepoint

public void FillDropDownListChoice(SPList list, DropDownList drpList, string columnName)
                SPFieldChoice field = (SPFieldChoice)list.Fields[columnName];
                drpList.DataSource = field.Choices;
                if (columnName == Constants.FIELD_Language)
                    drpList.SelectedValue = "English";
            catch (Exception ex)
                logError("Error:In Filling Dropdown choice-" + drpList + ":", ex);

No comments:

Post a Comment

Seven steps to build and deploy SPFX web part to SharePoint

Install Node.JS Use this link to install Node.JS 2.        Install yeomen and gulp CMD>npm install –g y...