Telerik blogs

Very often you need to use RadDatePicker inside a grid or list component and if you have lots of records the standard approach is not the best choice.

Example:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
  <MasterTableView>
    <Columns>
      <telerik:GridTemplateColumn HeaderText="OrderDate" SortExpression="OrderDate">
        <ItemTemplate>
          <telerik:RadDatePicker ID="RadDatePicker1" DbSelectedDate='<%# Eval("OrderDate") %>' runat="server" />
        </ItemTemplate>
      </telerik:GridTemplateColumn>
    </Columns>
  </MasterTableView>
</telerik:RadGrid>

In this case you will get new date picker component for every grid row. Possible improvement can be SharedCalendarID property similar to this example however even in this case you will get RadDateInput for every grid row.

With our RadControls for ASP.NET AJAX Q2 2008 Futures we added small and powerful example how to enable date pickers for hundreds and thousands traditional TextBox controls with just few lines of code. You can check the example here:

http://www.telerik.com/demos/aspnet/prometheus-futures/Calendar/Examples/DatePicker/SharedDatePicker/DefaultCS.aspx

One picker to rule them all!

Enjoy :)


About the Author

Vladimir Enchev

is Director of Engineering, Native Mobile UI & Frameworks

Comments

Comments are disabled in preview mode.