Remove rows randomly

3 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
  3. hurman
    hurman avatar
    2 posts
    Member since:
    Jan 2020

    Posted 15 Jan 2020 Link to this post

    I have read what you have written but i think i have a better plan to solve it
    i found a video on it on YouTube (he practically explain everything in his video)
    How to generate unique random numbers in using c#
Back to Top