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

set Edit index in GridTableView

3 Answers 196 Views
Grid
This is a migrated thread and some comments may be shown as answers.
michael
Top achievements
Rank 1
michael asked on 19 Mar 2010, 06:46 AM

How to Add new Record(And Put it in Edit Mode) in GridTableView inside RadGrid Programatically

I did Add Empty Row in Grid but I am not able set it's edit index to put it in edit mode.

I use below statement.
RadGrid.EditIndexes.ChildIndexes(0,0).Add(0)

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Mar 2010, 10:17 AM
Hi,

Pelase have a look at the link below where a similar issue has been discussed.
Edit Mode After insert row automaticlay

Princy
0
michael
Top achievements
Rank 1
answered on 20 Mar 2010, 06:50 AM
Thanxs for your reply.
    Actual I want to know how to set Edit index Programatically for GridTableView inside RadGrid

example
I set Edit index in RadGrid with  RadGrid.EditIndexes.Add(RowIndex);


But
I want  set Edit index in GridTableView which is inside RadGrid.

i tried something like RadGrid.ChildIndexes(parentIndex,DetailedtabelInex).Add(RowIndex)

but I failed . please help me solved it.
0
Accepted
Princy
Top achievements
Rank 2
answered on 22 Mar 2010, 06:24 AM
Hi,

Try the code snippet below to access the child table and set in edit mode

protected void RadGrid1_PreRender(object sender, EventArgs e)  
    {  
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items)  
        {  
            if (item.HasChildItems)  
            {  
                GridTableView childTable = (GridTableView)item.ChildItem.NestedTableViews[0];  
                foreach (GridDataItem childitem in childTable.Items)  
                {  
                   //Check for the newly inserted row 
                   //and set in edit mode 
                   //childitem.Edit=true; 
                }  
            }  
        }  
        RadGrid1.MasterTableView.Rebind();  
    }  

Princy
Tags
Grid
Asked by
michael
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
michael
Top achievements
Rank 1
Share this question
or