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

[Solved] change column settings anytime

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gerard Eikelboom
Top achievements
Rank 1
Gerard Eikelboom asked on 08 Mar 2011, 11:49 AM
Hello,

We have a grid and the columns are build using client templates.
 Here an example:
.ClientTemplate("<input type='text' class='besteldaantal' name='BesteldAantal' onkeyup='ValidateInput(this,<#=VoorraadEenheden#>)' onclick='ShowProductDetails(<#= artikelID #>)' />");

outside the grid I use a Combobox.
What I like to do is when I change the combobox Item.(that works ok) I want the column in my grid to have a new style.
And that for the whole grid.
What works is:
$('.besteldaantal').css('display', 'none');
It sets the column correct.
But what we do is when ComboBox Item changed is:
var Vgrid = $Voorraadgrid.data('tGrid');
       Vgrid.rebind();
We get new data. and rebind it.
I tried:
var Vgrid = $Voorraadgrid.data('tGrid');
       Vgrid.rebind();
       $('.besteldaantal').css('display', 'none');

So after the rebind set the column.
But that didn't work.
The only thing changed is that I first get new data bind it and change a column.
What am i doing wrong here?

Regards,
Gerard

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 08 Mar 2011, 12:49 PM
Hi Gerard Eikelboom,

I am not really sure that I understand your scenario correctly so my reply may not be relevant.

The rebind method binds the grid asynchronously.  This means that the grid is not bound immediately after calling the rebind method. You need to use the OnDataBound client-side event and execute your code there.

Regards,
Atanas Korchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Gerard Eikelboom
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or