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

[Solved] Unable to disable Master Insert when clicked on detail edit

2 Answers 106 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 05 Feb 2010, 05:30 PM
I am unable to disable insert mode when the user clicks on edit button, first the user clicks on insert then I am using editforms to insert, the user expands the detail grid and clicks on edit button (in detail grid) without completing the insert operation. In this scenario in order to disable insert I am using the following code in grid item command event to disable insert before enabling the edit but this isn't working.

        If e.Item.OwnerTableView.Name = "DetailTB" Then  
            If e.CommandName = RadGrid.EditCommandName Then  
                RadGrid1.MasterTableView.IsItemInserted = False 
            End If  
        End If 

it is not throwing any error, it is setting the IsItemInserted property but not disabling the insert mode

any suggestions !!!!!

--
Kevin

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 08 Feb 2010, 05:53 AM
Hello Kevin,

Try the following code snippet in PreRender event in order to hide the insert form when datil table item is in editmode.

CS:
 
    protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        if (RadGrid1.EditIndexes.Count != 0) 
        { 
            RadGrid1.MasterTableView.IsItemInserted = false
            RadGrid1.MasterTableView.Rebind(); 
        } 
    } 

-Shinu.
0
Kevin
Top achievements
Rank 1
answered on 08 Feb 2010, 03:42 PM
Thanks Shinu, Thts perfect
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Kevin
Top achievements
Rank 1
Share this question
or