This is a migrated thread and some comments may be shown as answers.

How can I allow deleting only first row in RadGrid?

1 Answer 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
GrZeCh
Top achievements
Rank 2
GrZeCh asked on 14 Jul 2008, 10:29 PM
Hello!

Can You help me with this? How can I make RadGrid to allow deleting only first row in RadGrid (first is latest).

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 15 Jul 2008, 04:30 AM

Hi GrZeCh,

Give a try with the following approach and see whether it helps.

CS:

 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        if ((e.CommandName == "Delete")&&(e.Item is GridDataItem))  
        {  
            GridDataItem item = (GridDataItem)e.Item;  
            string strindx = item.ItemIndex.ToString();  
            if (strindx == "0")  
            {   
             //code for delete  
            }  
        }  
   } 


Thanks
Princy
Tags
Grid
Asked by
GrZeCh
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or