Link to home
Start Free TrialLog in
Avatar of swathi111
swathi111

asked on

Delete Row from Grid

Hi,

Pls find the attached image.

I have 2 dropdowns (NewsSector, NewsSectorType). when i select values from these 2 dropdowns and click on Add button, it will add rows to grid.
For each row I have Delete icon(img button), when user click on this button i have to delete row from grid(not from database).
Pls note that on click of this delete button, data should not be deleted from db. only from the grid?

how to do this?

pls find the code below:

protected void RadGridNewsSectorType_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                //pls help me to write code here
            }
        }
grid.jpg
Avatar of Obadiah Christopher
Obadiah Christopher
Flag of India image

Please show us the code you have used to bind the gridview.
Avatar of swathi111
swathi111

ASKER

Hi,

Pls find the attached file for code which i used to bind the grid
code.txt
Int index=((GridviewRow)sender).RowIndex
RadGridNewsSectorType.Rows.Delete(index);
ASKER CERTIFIED SOLUTION
Avatar of Armand G
Armand G
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial