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

Remove control from grid cell

2 Answers 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gerry Polami
Top achievements
Rank 1
Gerry Polami asked on 10 Feb 2011, 03:12 PM
Hi
I have a radgrid wich his first column is a bounded GridDropDownColumn.
I want (after binding) to remove the DropDown from the first column of the first row.
How do i do it ?
Thanks ,
Gerry

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Feb 2011, 05:19 AM
Hello,


The folowing code will help you in hidingt the DropDownList in EditForm for the first row in grid.

Code:
  protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
  {
      if (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.ItemIndex ==0)
      {            
          GridEditFormItem editItem = (GridEditFormItem)e.Item;
          RadComboBox dropdown = (RadComboBox)editItem["GridDropDownColumn1"].Controls[0];
          dropdown.Visible = false;
      }
}




Thanks
Princy.
0
Gerry Polami
Top achievements
Rank 1
answered on 13 Feb 2011, 09:46 AM
Hi Princy,
My DropDown is a GridDataItem and it doesn't work's with the code you gave me (When i change the code to GridDataItem ,it falls for casting)
What can i do ?
Thnaks,
Gerry
Tags
Grid
Asked by
Gerry Polami
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Gerry Polami
Top achievements
Rank 1
Share this question
or