Listview selection noob (How to select and delete?)

4 posts, 0 answers
  1. Paul
    Paul avatar
    27 posts
    Member since:
    Feb 2012

    Posted 22 Feb 2012 Link to this post

    Much as I enjoy the hunt for what I'm missing I hope someone out there will take pity on me and help me along the learning curve ;)
    I have a listview databound to a LINQ query and all works fine.  I need the user to be able to select an item, by clicking on it's icon and deleting it.  So, in my ASPX I have this:

    <asp:ImageButton ID="categoryImageBtn" OnClick="categoryBtn_Click" CommandName="Select" Height="30" Width="50" runat="server" ImageUrl='<%# Eval("ImagePath") %>' />

    And in my codebehind I have this:

     

    protected void myProjectListView_ItemCommand(object sender, RadListViewCommandEventArgs e)

    {
    if (e.CommandName == RadListView.SelectCommandName)

    {

    Label2.Text = "Bingo";
    }
    }

    Just to see if it's working and needless to say... no luck :(  I know the button works, as I wired up an onCLick event that fires fine.

     

    I've tried various approaches in the tutorials with no luck. 

     

    I'd be very very grateful if someone could take a moment to point me in the right direction!

     

    Paul

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  2. Paul
    Paul avatar
    27 posts
    Member since:
    Feb 2012

    Posted 23 Feb 2012 Link to this post

    Got it... was a databinding issue which I found buried in another thread.  Moved my databinding into the "needsData" event and worked like a charm.  I read a number of people with the same problem so hopefully this helps someone.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stephan
    Stephan avatar
    33 posts
    Member since:
    Jun 2012

    Posted 21 Mar 2012 Link to this post

    You should have had a link to the one that helped you out.

    Still looking.
  5. Paul
    Paul avatar
    27 posts
    Member since:
    Feb 2012

    Posted 21 Mar 2012 Link to this post

    Try what I did, and perform your databinding in the "needsData" event handler...
Back to Top