Last active
January 22, 2018 14:21
-
-
Save diogobaltazar/9ea73515ea3471c69979e9e986da67bd to your computer and use it in GitHub Desktop.
(C#) Risco de overloading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void PopulateDropDown(DropDownList dropDown, SPList listUrl, string field, bool addSelectedItem = true) | |
{ | |
int iterator = 0; | |
var valores = Utils.ListFieldToDropDown(listUrl, field); | |
if (addSelectedItem) | |
{ | |
AddDefaultValueDropDownList(dropDown); | |
iterator++; | |
} | |
foreach (String valor in valores) | |
{ | |
dropDown.Items.Insert(iterator, new ListItem(valor, iterator.ToString())); | |
iterator++; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void PopulateDropDown(DropDownList dropDown, SPList listUrl, string field, bool addSelectedItem = true) | |
{ | |
var valores = Utils.ListFieldToDropDown(listUrl, field); | |
if (addSelectedItem) | |
{ | |
AddDefaultValueDropDownList(dropDown); | |
} | |
int iterator = 1; | |
foreach (String valor in valores) | |
{ | |
dropDown.Items.Insert(iterator, new ListItem(valor, iterator.ToString())); | |
iterator++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Changing the signature with a default field still requires thorough understanding of the implications