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

hide ExpandCollapse header

3 Answers 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sunitha
Top achievements
Rank 1
sunitha asked on 17 Oct 2008, 09:03 AM
Hi..
I'm stuck at one issue!!!!

I'm able to hide the default expandcollapse column in the body of the grid but the header still maintains the column, thus leaving an blank column at the end in the body.
I tried the following code in the onclick of my button functionality (Also tried placing in pre-render and column-created)

 

For Each item As GridDataItem In RGResults.Items

 

item.Item(

"ExpandColumn").Visible = False

 

item.Item(

"ExpandColumn").Width = 0

 

 

Next

 

 

For Each headerItem As GridGroupHeaderItem In RGResults.MasterTableView.GetItems(GridItemType.GroupHeader)

 

 

CType(headerItem.Controls(0).Controls(0), Button).Visible = False

 

 

Next

 

 

If isEdit AndAlso TypeOf RGResults.Columns(0) Is GridExpandColumn Then

 

RGResults.Columns(0).Display =

False

 

 

End If

Can this be fixed without creating a custom templatecolumn for the expand functionality..

Thanks!

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Oct 2008, 12:33 PM
Hi Sunitha,

Have you set AllowRowResize property to true? If so try setting it to false and see if the extra blank column is getting removed.

ASPX:
<ClientSettings> 
 <Resizing    AllowRowResize="false"  /> 
</ClientSettings> 


Thanks
Shinu.
0
sunitha
Top achievements
Rank 1
answered on 20 Oct 2008, 08:07 PM
Thanks Shinu.
I was able to resolve the issue with a combination of

grid.MasterTableView.ExpandCollapseColumn.Display =

False
and
<
Resizing AllowRowResize="true" AllowColumnResize="false" />

What I now see is a space column in the grid header that is displayed in the rendered html as
<td class="ResizeItem_NCCI">&nbsp;</td>

 

How do I remove this blank column?  Thanks!
0
Sebastian
Telerik team
answered on 20 Nov 2008, 09:59 AM
Hi sunitha ,

Up to your questions:

1)      You can choose different approach to hide the expand/collapse column in the grid when there are no records available under a certain parent. It is demonstrated in the following topic from the documentation:

http://www.telerik.com/help/aspnet-ajax/grdhideexpandcollapseimageswhennorecords.html

Thus you do not need to enable row resizing at all and no extra column will be generated.

2)      To display loading panel when paging action occurs, consider using RadAjaxManager to ajaxify the grid and associate it with RadAjaxLoadingPanel as demonstrated here:

http://demos.telerik.com/ASPNET/Prometheus/Grid/Examples/GroupBy/OutlookStyle/DefaultCS.aspx

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
sunitha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
sunitha
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or