mahesh
mahesh

Reputation: 3217

How to delete multiple rows in the radgrid based on the checkbox checked

I have a radgrid where item is being binded from codebehind ,how can delete specific rows in the grid based on the checkbox checked , and save the changes to the database.

Upvotes: 0

Views: 1564

Answers (1)

Parth Patel
Parth Patel

Reputation: 258

You can bind checkbox like:

<telerik:GridTemplateColumn>     
      <ItemTemplate>     
            <input type="checkbox" name="chkBox" value='<%# DataBinder.Eval(Container.DataItem, "idKnowledgeArea") %>' />   
      </ItemTemplate>      
</telerik:GridTemplateColumn>

You have to bind ID to checkbox value. After this when you click delete button then you will get checked checkboxes by :

Request.Form["chkBox"].Replace("'", String.Empty)

So you will get checked checkboxes IDs. After that you will write your delete code and then you just write code for grid rebind as:

Grid.Rebind();

Upvotes: 1

Related Questions