Posts

Showing posts with the label Bind

Bind dropdownlist to enum

public static ListItemCollection GetListItemsFromEnum ( Type enumType ) { ListItemCollection items = new ListItemCollection (); string [] names = Enum . GetNames ( enumType ); Array values = Enum . GetValues ( enumType ); for ( int i = 0 ; i <= names . Length - 1 ; i ++) { items . Add ( new ListItem ( names [ i ], values . GetValue ( i ). ToString ())); } return items ; }

Telerik DatePicker Bind with Database Datetime field

<telerik:RadDatePicker ID="ToDate" runat="server" DbSelectedDate='<%# Bind("ToDate") %>'  >  <DateInput ID="DateInput1" runat="server" DateFormat="MM/dd/yyyy" DisplayDateFormat="dd/MM/yyyy">  </DateInput>  </telerik:RadDatePicker> DbSelectedDate : This property don't use to show but it will work