Hide templates on insert?

4 posts, 0 answers
  1. ToltingColtAcres
    ToltingColtAcres avatar
    83 posts
    Member since:
    Nov 2010

    Posted 02 Jan 2013 Link to this post

    I'm using a radlistview w/ a pagesize of 1 to simulate a winforms data entry screen for data collection on an ipad.

    When I click to have the user add a new record, the current record is displayed at the top of the screen and a second insert record is displayed at the bottom.

    Is there a way for me to only show the insertitemtemplate and hide the other templates when doing an insert?

    Thanks,
    Mike
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 07 Jan 2013 Link to this post

    Hi Mike,

    This is a custom functionality that depends on your logic and is not supported from the control. However, is you want the InsertedItemTemplate to be shown as first item you can use the code snippet below inside ItemCommand event:

    RadListView1.InsertItemPosition = RadListViewInsertItemPosition.FirstItem;

    Kind regards,
    Pavlina
    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. ToltingColtAcres
    ToltingColtAcres avatar
    83 posts
    Member since:
    Nov 2010

    Posted 07 Jan 2013 Link to this post

    HI... Thanks for the response. This is what I am doing now, and I make the insert template just large enough such that it forces the existing record template "off" the screen (unless you scroll, of course :) ) which on the iPad has a "winforms" look and feel to it.

    We're attempting to take an existing Winforms application running on tablet computers using merge replication and migrate it to a web-based iPad app w/o needing to retrain hundreds of sales reps, so the closest I can get the app to the existing Winforms program, the better.

    Again, thanks for the help.    
  5. Bill Dowis
    Bill Dowis avatar
    1 posts
    Member since:
    Mar 2006

    Posted 06 Apr 2014 in reply to ToltingColtAcres Link to this post

    Hi Mike,

    Try this:

    ​  protected void btnAddNew_Click(object sender, EventArgs e) {
        RadListView1.ShowInsertItem();   
        if (RadListView1.Items.Count > 0) {
          RadListView1.Items[0].Visible = false;
        }
      }
Back to Top