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

[Solved] Need to enable while insert and disable while Edit

2 Answers 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Anto (DLL Version : 2008.3.1314.35) asked on 18 Jun 2009, 08:10 AM

Hi All

I have a radgrid.

With the option of automatic Insert/Update/Delete.

It works fine.

There are five fields. The first one is modificationNum

 

I need is:

 

This field should not be able to modify while edit is clicked, But it must be able to enter data while insert.

 

Is there any option for this.

 

-Anto

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 18 Jun 2009, 08:45 AM
Hi Anto,

Try the following code snippet and see whether it helps.

CS:
 
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    if (e.Item is GridEditableItem && e.Item.IsInEditMode && !e.Item.OwnerTableView.IsItemInserted) 
    { 
        GridEditableItem editItem = e.Item as GridEditableItem; 
        TextBox txtbox = (TextBox)editItem["modificationNum"].Controls[0]; 
        txtbox.Enabled = false;             
    } 

Thanks,
Shinu.
0
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
answered on 20 Jun 2009, 08:38 AM
Hi Shinu,

Thank You very much

-Anto
Tags
Grid
Asked by
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
Share this question
or