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

[Solved] controls.clear

1 Answer 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ayesha
Top achievements
Rank 1
Ayesha asked on 10 Sep 2009, 06:59 PM
Hi,

In my scenario, I've a remove btn which on clicking should remove the rows.(I cannot rebind the grid). I manually have to
clear the controls.

So, I do the foll:

foreach(GridDataItem obItem in Radgrid1.SelectedItems)
{
 obItem.Controls.Clear();
}

But the problem with this approach is , though it clears the rows . the grid has an empty row. I don't need the row at all.

When user selects a row and clicks remove btn, he should not see the contents as well as grid lines. pls help me with code.

Note: pls I cannot rebind. so , give me a diff approach.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Sep 2009, 04:12 AM
Hi Zaheka,

Can you try hiding the Grid row using the Visible property and see whether it helps.

CS:
 
 protected void Button1_Click(object sender, EventArgs e) 
    { 
 
        foreach (GridDataItem item in RadGrid2.SelectedItems) 
        { 
            item.Visible = false
        } 
    } 


Thanks
Shinu
Tags
Grid
Asked by
Ayesha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or