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

Hide row on inline edit

1 Answer 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Emerson
Top achievements
Rank 1
Emerson asked on 08 Jul 2013, 08:44 PM
I have a grid and am using javascript to hide text and label based on the value of a dropdown within the same grid, during an Insert. Now using server side code on itemCommand  in edit mode i need to check one field and hide another row based on value of first. The row I need to hide is a GridBoundColumn. I have been able to hide the textbox, but the label is still there. How can I hide the whole row so that none of this appears?

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 1
answered on 09 Jul 2013, 06:41 AM
Hi Emerson,

I am not sure about your requirement.Here is the code snippet I tried to hide the Text Box in edit mode with the label(BoundColumn) in Editmode="EditForms". In InPlace Edit Mode the label for the text-box will be in the header.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridEditableItem && e.Item.IsInEditMode)
       {
           GridEditableItem item = (GridEditableItem)e.Item;
           if(your condition)
           {
               TextBox txtBox = (TextBox)item["OrderID"].Controls[0]; //accessing TextBox(BoundColumn)
               txtBox.Parent.Parent.Visible = false;//hiding Label and TextBox
           }
       }
   }

Please Provide the code snippet If it doesn't help.

Thanks,
Princy

Tags
Grid
Asked by
Emerson
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or