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

[Solved] How to remove item-inserting row

2 Answers 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fabio
Top achievements
Rank 1
Fabio asked on 20 May 2009, 08:48 AM
Hi, I've some radcomboboxes and a radgrid, which is re-loaded after the changing of the comboboxes.
In the radgrid I can, when the grid is empty, insert a new row using the CommandItem.
All works fine, but I'd like to remove the inserting row when I change any of the comboboxes selected value
before updating or canceling on the inserting row.

I tried almost anything, but with no results till now.


Thanks for your help.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 May 2009, 09:14 AM
Hello Fabio,

If you want to remove the insert row on changing the selection on the RadComboBox, you can try out the following code. Also you can use the same event handler for all the comboboxes.
c#:
 protected void ComboBox_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
    { 
        RadComboBox combo = (RadComboBox)o; 
        if (RadGrid1.MasterTableView.IsItemInserted) 
        { 
            RadGrid1.MasterTableView.IsItemInserted = false
            RadGrid1.Rebind(); 
        } 
    } 

Thanks
Princy.
0
Fabio
Top achievements
Rank 1
answered on 20 May 2009, 09:36 AM
It works perfectly! :D

Thank you very much :)
Tags
Grid
Asked by
Fabio
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Fabio
Top achievements
Rank 1
Share this question
or