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

how to set Column Width

1 Answer 85 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.
Dharam Narayan
Top achievements
Rank 1
Dharam Narayan asked on 22 Apr 2010, 09:43 AM
hi ,

I have made  an MVC appliction and used the telerik to show Grid . My code and structure are similiar to 
http://demos.telerik.com/aspnet-mvc/Grid/EditingServerSide/ALFKI?Grid-mode=edit   .

In the normal view my column width get set to the size of  content  which is largest in that column .
In the Edit mode how will my TextBox be set to the column width.

using the  code
 columns.Add(o => o.ColumnName).Width(120);


Or   how to  set  column width to be same as I set for the  TextBox .


Thanks in Advance
 DNM

  

1 Answer, 1 is accepted

Sort by
0
Bob
Top achievements
Rank 1
answered on 23 Apr 2010, 02:59 AM
Hi DNM,

I am new to Telerik and MVC, but I have had this problem and here is what works for me:

    <script src='<%= ResolveUrl("~/Scripts/jquery-1.4.1.js") %>' type="text/javascript"></script>  
 
    <script type="text/javascript">  
        $(document).ready(function() {  
            $('button').width($('#button13').width());  
            $('#inputyear').width($('#button13').width() - 15);  
        });  
    </script>  
 

I hope it works as well for you!

Bob Bennett
Tags
Grid
Asked by
Dharam Narayan
Top achievements
Rank 1
Answers by
Bob
Top achievements
Rank 1
Share this question
or