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

Hide editable item

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 08 Nov 2010, 05:12 PM
Hi,
I have a bound grid to an entity datasource and can edit the data correctly.
One of the columns is a key (plantID) that is initially passed in from the load as a parameter on the datasource.
This key value needs to be defaulted to that same parameter value when I am adding a record....
I can do this fine using

       If (e.CommandName = RadGrid.InitInsertCommandName) Then
            'cancel the default operation
            e.Canceled = True

            'Prepare an IDictionary with the predefined values
            Dim newValues As System.Collections.Specialized.ListDictionary = New System.Collections.Specialized.ListDictionary()
            newValues("plantID") = Session("PlantID")

            'Insert the item and rebind
            e.Item.OwnerTableView.InsertItem(newValues)
        End If

When I go to add a new record there is a textbox with the correct session value for plantID in there and the value inserts ok...
What I want to do though is hide this text box when the grid is in edit mode - but I can't seem to do it without forcing the column to be read only - which obviously defeats the object...
Is there a way of using the default insert value as above but not displaying the textbox in edit mode?

Thanks in advance for any help...

1 Answer, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 08 Nov 2010, 05:26 PM
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Share this question
or