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.
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 18 Nov 2011 Link to this post


    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"

    Jayesh Goyani
Back to Top