Remove rows randomly

2 posts, 0 answers
  1. Roy Halvorsen
    Roy Halvorsen avatar
    83 posts
    Member since:
    Oct 2008

    Posted 18 Nov 2011 Link to this post

    How can I remove a row from a RadGrid randomly by clicking a button outside the RadGrid? Let's say I am using random numbers, and I want the row with the same index as the random number i create to be removed. But I also want to get the DataKeyName from that row so I can use it to tell in a label what row has been removed.
    Roy
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 18 Nov 2011 Link to this post

    Hello,

    You can find datakey by using index with the help of below code.

    string strID = RadGrid1.MasterTableView.Items[1].GetDataKeyValue("ID").ToString();
     
    //Remove Item index was "1"


    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top