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

[Solved] Hiding Rqad Grid ExpandColumn while inserting

2 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
COLIN
Top achievements
Rank 1
COLIN asked on 20 Jul 2009, 09:25 PM
Hello,
I'm having a formating issue displaying my hierarchal grid in while my Grid is in insert mode.
When i switch my grid to insert mode i hide the ExpandColun.
protected void _orgGrid_ItemCreated(object sender, GridItemEventArgs e) 
        { 
            if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
            { 
                if (editItem.OwnerTableView.IsItemInserted) 
                {     
                     _orgGrid.MasterTableView.GetColumn("ExpandColumn").Display = false;  
                } 
            } 
However, this causes my insert template (a user control) to be rendered in the second column of my grid and the first column has a large empty space.
Is there something i can do to force my user control to span across all columns?

The main goal i'm trying to achieve is to disable expanding of rows while the user is inserting an item.
Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 21 Jul 2009, 06:50 AM
Hi Colin,

Try the following approach to hide the Expand/Collpase button when the Grid is in Insert mode and see whether it helps.

CS:
 
 protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
        { 
            GridEditableItem editItem = (GridEditableItem)e.Item; 
 
            if (editItem.OwnerTableView.IsItemInserted) 
            { 
 
                foreach (GridDataItem dataItem in RadGrid2.MasterTableView.Items) 
                { 
                    dataItem["ExpandColumn"].Controls[0].Visible = false
                    
                } 
 
                 
            } 
        }  
    } 


Regards
Shinu.
0
COLIN
Top achievements
Rank 1
answered on 21 Jul 2009, 01:12 PM
Thanks for your help.
This now hides each individual Expand/Collapse control but will keep the column.
Tags
Grid
Asked by
COLIN
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
COLIN
Top achievements
Rank 1
Share this question
or