RadDateTimePicker in layout template firing InitInsert command

3 posts, 1 answers
  1. Jacek
    Jacek avatar
    31 posts
    Member since:
    Sep 2011

    Posted 21 Sep 2012 Link to this post

    Hi,

    I would like the RadDateTimePicker located in LayoutTemplate to fire InitInsert command.
    The problem is, RadDateTimePicker does not have CommandName property (and CommandArguments), so the only way to do that would be to fire command from SelectedDateChanged.

    I understand that RadListViewDataItem can use FireCommandEvent method, but how to get RadListViewDataItem when the RadListVIew is empty?

    In other words, how to make the following to start working as intended above

    protected void myDatePicker_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
            {
                RadListViewDataItem r = new RadListViewDataItem(myRadListView, 0);
                r.FireCommandEvent("InitInsert", String.Empty);
            }

    Thanks,
    Jacek

  2. Answer
    Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 25 Sep 2012 Link to this post

    Hello Jacek,

    You could use the following method:
    RadListView1.ShowInsertItem();
    As demonstrated in the following demo:
    http://demos.telerik.com/aspnet-ajax/listview/examples/templates/editinserttemplates/defaultcs.aspx

    An alternative approach would be to use a client-side fireCommand:
    http://www.telerik.com/help/aspnet-ajax/listview-firecommand.html

    That should do the trick. Please give it a try and let me know about the result.

    Kind regards,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jacek
    Jacek avatar
    31 posts
    Member since:
    Sep 2011

    Posted 25 Sep 2012 Link to this post

    Great, thanks!
Back to Top