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

[Solved] Grid Column resizing issue

4 Answers 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ferdinand
Top achievements
Rank 1
Ferdinand asked on 21 Sep 2009, 02:53 PM
Hi,
I got a little problem with the resizing of Grid columns. I defined my Grid like this:
<telerik:RadGrid ID="RadGrid1" runat="server" CssClass="radGrid" MasterTableView-NoMasterRecordsText="Keine Daten zum Anzeigen" 
                 BorderStyle="None" AutoGenerateColumns="false" EnableViewState="true" AllowSorting="True" Height="450" 
            AllowPaging="true" PageSize="40" Width="97%"
                <PagerStyle Visible="false" /> 
            <MasterTableView TableLayout="Fixed" /> 
            <ClientSettings> 
                <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" /> 
                <ClientEvents OnScroll="HandleScrolling" /> 
                <Resizing AllowColumnResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="true" ClipCellContentOnResize="false" /> 
            </ClientSettings> 
            </telerik:RadGrid> 
All my columns are defined programatically like this:
GridTemplateColumn tf = new GridTemplateColumn() 
            { 
                HeaderTemplate = new EditTemplate(Resources.ToolbarRes.Edit_text, DataControlRowType.Header, editButton_Click), 
                ItemTemplate = new EditTemplate(Resources.ToolbarRes.Edit_text, DataControlRowType.DataRow, editButton_Click) 
            }; 
            tf.HeaderStyle.Width = 90; 
            tf.Resizable = false
            this.RadGrid1.Columns.Add(tf); 

So I am able to resize my columns. But if I resize them so much that the grid's former size is bigger than the actual one I still see some kind of rest of the header (some coloured stuff without font).
Moreover it seems to me that the ClipCellContentOnResize property does not have any effect on the behaviour. I still can resize the columns as narrow as I wish if I set it to false.
Another thing I realized is that the columns which are empty are sortable but all others are not. Is there any reason for this?
I would be glad about any help.

Best regards
Ferdinand

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 25 Sep 2009, 11:22 AM
Hello Ferdinand,

"So I am able to resize my columns. But if I resize them so much that the grid's former size is bigger than the actual one I still see some kind of rest of the header (some coloured stuff without font). "

Static header's width won't be affected when you resize the columns.

"Moreover it seems to me that the ClipCellContentOnResize property does not have any effect on the behaviour. I still can resize the columns as narrow as I wish if I set it to false."
Remove the static headers and your columns will behave as expected.

"Another thing I realized is that the columns which are empty are sortable but all others are not. Is there any reason for this?"
I'm not sure what is the problem here. Do you have SortExpression and HeaderText?

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ferdinand
Top achievements
Rank 1
answered on 25 Sep 2009, 11:35 AM
Hi Daniel,
thanks for your answer. I was able to solve the sorting problem by myself. I did not consider that my headertemplate was not designed for sorting and by chance the empty columns were boud column so that sorting worked with them. I replaced my headertemplate by a simple headertext and a sortexpression and now it works fine.
I will try to remove static headers to check if the behaviour is more like expected.


0
Daniel
Telerik team
answered on 30 Sep 2009, 01:05 PM
Hello Ferdinand,

I'm glad that you managed to sort out the problem on your own. Let me know whether you need further assistance or we can consider this case closed.

Kind regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ferdinand
Top achievements
Rank 1
answered on 01 Oct 2009, 09:51 AM
Hello Daniel,
you can consider the issue as solved.
Thanks for your help.

Best regards
Ferdinand
Tags
Grid
Asked by
Ferdinand
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Ferdinand
Top achievements
Rank 1
Share this question
or