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

How to Clear indexes at insert new item (RadGrid)

3 Answers 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 31 Oct 2008, 04:02 PM
Hi all,

I have a RadGrid and i'm using an user control to edit and insert items. For me it works fine, but the deal is that i need to restrict the user for editing and inserting at the same time.

If the user is editing and click new item it needs to close the editing row  and open the inserting row and if i'm adding an item and i click on edit an item the inserting row needs to close and open the editing row

So  I have the event:

_____________________________

protected void myRadgrid_ItemCommand(object sender, GridCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "Edit":
                this._edit = true; //bool value
                break;
            case "InitInsert":
                this._edit = false;
                this.rgTercero.EditIndexes.Clear();
                break;
            default:
                break;
        }
    }
________________________________

With that code when i'm editing and i clicked "insert new item" it close the editing row and open the inserting row(that works fine). But my problem is that i couldn't find the property to do the same when i am adding a register and i try to edit a row (it most close the inserting row and open the editing one).

I hope that you can help me with this, it's really important

Thx a lot

Regards,

Daniel Peralta

3 Answers, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
answered on 01 Nov 2008, 06:59 PM
please someone that can help me with this .... it's very important
0
Accepted
Shinu
Top achievements
Rank 1
answered on 03 Nov 2008, 04:50 AM
Hi Daniel,

Check out the following help article which explains how to achieve the desired scenario.
Switching the Insert/Updade/Regular Modes

Regards
Shinu.
0
Daniel
Top achievements
Rank 1
answered on 03 Nov 2008, 04:22 PM
Thx Shinu,

That was exactly what i was looking for
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Daniel
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Share this question
or