CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of dropdownlist
C#
DropDownList.SelectedIndex = DropDownList.Items.IndexOf(DropDownList.Items.FindByValue("Value"));
by Egli   July 18, 2011 @ 4:28pm
110 Views
no comments
 
C#
/// <summary>
/// Sorts the dropdownlist in descending order
/// </summary>
/// <param name="objDDL"></param>
private void SortDropDownList(ref DropDownList objDDL)
{
    var textList = new ArrayList();
    var valueList = new ArrayList();
 
    foreach (ListItem li in objDDL.Items)
by Abhilash   November 13, 2009 @ 4:03am
496 Views
no comments
 
C#
[TestFixture]
public class DropDownListExpressionTester {
 
   [Test]
   public void should_add_specified_custom_html_attributes() {
      var viewModel = new DropDownListViewModel();
 
      var expr = new DropDownListExpression<DropDownListViewModel>(viewModel, c => c.Value, "");
      expr.HtmlAttributes.Add("disabled", "disabled");
by Rob S   October 02, 2009 @ 3:16pm
281 Views
no comments
 
C#
public static DropDownListExpression<VIEWMODEL> DropDownFor<VIEWMODEL>(
      this IFubuView<VIEWMODEL> viewPage, Expression<Func<VIEWMODEL, object>> expression)
   where VIEWMODEL : class {
 
   return new DropDownListExpression<VIEWMODEL>(viewPage.Model, expression, "");
}
 
by Rob S   October 02, 2009 @ 3:11pm
324 Views
no comments
 
C#
public class DropDownListExpression<VIEWMODEL> : BoundExpression<VIEWMODEL, DropDownListExpression<VIEWMODEL>>
   where VIEWMODEL : class {
 
   private readonly Accessor _accessor;
   private readonly object _value;
   private readonly string _name;
 
   public DropDownListExpression(VIEWMODEL viewModel, Expression<Func<VIEWMODEL, object>> expression, string prefix)
      : base(viewModel, expression, prefix) {
      _accessor = ReflectionHelper.GetAccessor(expression);
by Rob S   October 02, 2009 @ 3:07pm
320 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate