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

[Solved] Hidding Field in EditMode on DetailsView

2 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcio Nascimento
Top achievements
Rank 1
Marcio Nascimento asked on 08 Oct 2009, 03:33 PM
Hi there,

Well, I'm having trouble in how to hide fields in EditMode when use DetailsView.

I tried without success with the following code...

        string nome = e.Item.OwnerTableView.Name;  
        if (nome == "valores")  
        {  
            if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))  
            {  
                GridEditFormItem myColumn = (GridEditFormItem)e.Item;  
                {  
                    myColumn["id_postosQT"].Parent.Visible = false;  
                }  
            }  
        } 

The error is: Cannot find a cell bound to column name 'id_postosQT'.

Someone could give me a hand on this ?

Regards,

Marcio Nascimento

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 09 Oct 2009, 10:52 AM
Hi Marcio,

I tried your code and it is working fine in my end. It is hiding the column when I click on Edit button of the DetailTable. Could you check whether you have column named id_postosQT in DetailTable valores ?

-Shinu.
0
Marcio Nascimento
Top achievements
Rank 1
answered on 15 Oct 2009, 03:06 PM
Hi Shinu,

You're right. The column id was not set up correctly.
Sometimes I forget the basics....

Thanks.

Marcio Nascimento
Tags
Grid
Asked by
Marcio Nascimento
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Marcio Nascimento
Top achievements
Rank 1
Share this question
or