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

Custom column in Edit modal

3 Answers 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krutika
Top achievements
Rank 1
Krutika asked on 15 Nov 2012, 01:15 AM
I have a Radgrid with a custom column(rowID) added to it.
The custom column is in hidden mode in the radgrid.
All the columns in the grid are built dynamically at runtime, no template used.
And EditMode = Popup.

While Inserting or Updating rows, the custom column (rowID) is displayed at the top of the EditFormat.
I want to hide the first row which contains the label for custom column and its value.
How can I hide that column and its value?


3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Nov 2012, 04:54 AM
Hi,

You can set the ReadOnly property for hiding the column in edit mode.
C#:
GridBoundColumn boundColumn;
 boundColumn = new GridBoundColumn();
 RadGrid1.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "ID";
 boundColumn.ReadOnly = true;

Thanks,
Shinu.
0
Krutika
Top achievements
Rank 1
answered on 15 Nov 2012, 04:22 PM
I tried both
boundColumn.Visible = False
boundColumn.[ReadOnly] = True.
The column still apears in the Edit mode for Insert and Update.
0
Krutika
Top achievements
Rank 1
answered on 15 Nov 2012, 09:54 PM

I got it.

Inside RadGrid1_ItemCommand

 Dim rowIdcol As GridBoundColumn = CType(e.Item.OwnerTableView.GetColumnSafe("rowId"), GridBoundColumn)
                If (e.CommandName = RadGrid.EditCommandName Or e.CommandName = RadGrid.PerformInsertCommandName Or e.CommandName = RadGrid.CancelCommandName) Then
                   rowIdcol.ReadOnly = True
                    rowIdcol.Display = False
                End If

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