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

Misalignment of column when a column is hidden

2 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nirmala
Top achievements
Rank 1
Nirmala asked on 04 Jan 2013, 11:41 PM
Hi, 

When a telerik grid is loaded ,  the column headers and item width match and they are aligned properly. 
But when we click on header context menu and hide one column then there is a mismatch with columns.
If i set AllowStaticHeaders="false" it works fine but i want static headers. I assigned fixed width for each column using Header style width property and TabeleLayout is Fixed.

Is there anyway to fix the issue?

Thanks,
Nimmy

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jan 2013, 03:55 AM
Hi,

Try the following javascript to achieve your scenario.
JS:
function OnColumnHidden(sender, args) {
       sender.get_masterTableView().get_element().style.tableLayout = "auto";
       sender.get_masterTableViewHeader().get_element().style.tableLayout = "auto";
       window.setTimeout(function () {
           sender.get_masterTableViewHeader().get_element().style.tableLayout = "fixed";
           sender.get_masterTableView().get_element().style.tableLayout = "fixed";
       }, 1)
   }

Thanks,
Shinu.
0
Nirmala
Top achievements
Rank 1
answered on 09 Jan 2013, 07:15 PM
Hi Shinu,

  Thanks for your suggestion. But unfortunately it didn't work. If I hide one column it works fine , But if hide more than one column and again start showing the column it stops working it keeps on giving javascript error.


Thanks,
Nimmy
Tags
Grid
Asked by
Nirmala
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Nirmala
Top achievements
Rank 1
Share this question
or