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

Adjust Filter textbox width different for different columns using javascript.

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abhijit Shetty
Top achievements
Rank 2
Abhijit Shetty asked on 19 Feb 2011, 06:06 PM
Hi,
I have a radgrid which is data bound using only javascript without any server side binding. Now i want to adjust filter box widths for different columns.
For Ex: If column name is "SR" then i have to adjust width to 30px. If column name is "Name" then adjust it to 50px.

Please let me know how to achieve it using javascript only.

Thanks in advance for helping...

1 Answer, 1 is accepted

Sort by
0
Accepted
Iana Tsolova
Telerik team
answered on 24 Feb 2011, 03:33 PM
Hello Abhijit,

After you bind the grid, you can get its columns collection using the get_columns() method. Then for each column you can get its element (get_element()) to get its cellIndex. To reference the grid filtering item <tr>, get the grid <thead> and the second childNode of it. Based on the above cellIndex you will know in which is the filter textbox for a specific column.
 
Greetings,
Iana
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
Abhijit Shetty
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
Share this question
or