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

make the grid to open in EditMode at the begining

4 Answers 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arash
Top achievements
Rank 1
Arash asked on 26 Oct 2010, 04:17 PM
Hi
I need to know how to make the grid to be opened at edit mode.
This must be happened after the grid is bind

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Oct 2010, 05:25 AM
Hi Arash,


The documentation shows how to put all rows in editmode when page loads.
Put all items in edit mode without additional rebind

Also you can access particular row and set the Edit property to True.
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    RadGrid1.MasterTableView.Items[0].Edit = true;
    RadGrid1.MasterTableView.Rebind();
}


-Shinu.
0
Arash
Top achievements
Rank 1
answered on 31 Oct 2010, 04:27 PM
Shinu Im really thankfull

but there is a problem!

the grid is always in edit mode even when I click on Cancel , Insert or Update links

please help

Thanks a lot
0
Shinu
Top achievements
Rank 2
answered on 01 Nov 2010, 06:15 AM
Hello Arash,


You could check for whether page is loaded initially or postback occurred using "IsPostBack" condition.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        RadGrid1.MasterTableView.Items[0].Edit = true;
        RadGrid1.MasterTableView.Rebind();
    }
}



-Shinu.
0
Arash
Top achievements
Rank 1
answered on 01 Nov 2010, 06:57 AM
Hi

I tried but in my case this does not work.

This might be because  I have some other controls that make the PostBack occoured.

I really have to solve this problem please...
Tags
Grid
Asked by
Arash
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Arash
Top achievements
Rank 1
Share this question
or