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

[Solved] Controlling Grid Row Height

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.
Mark
Top achievements
Rank 1
Mark asked on 10 Jun 2011, 05:35 PM
Hello,

I have searched the forum and found other questions that seem to hint a solution for programmatically controlling the rows height within a Grid but none that actually directly answer this question, so forgive me if it may sound redundant but it really isn't.

Based on suggestions to control other attributes of the Grid control, it would be fair to say that it can ONLY be accomplished using styles. So in effort of answering my own question, I'm guessing something like this in a style sheet for starts:

.t-grid

 

tr

 

 

{

 

 

  

line-height: 20px;

 

 }

But to take this a step further, how should it be applied to the Grid Control??? By surrounding the control in a div that applies the style like:

<div class="t-grid">

 

 

<% Html.Telerik()

.Grid<

MyGrid >()

 

 

.Name(

"MyGridResults")

 

 

.DataKeys(keys => keys.Add(model => model.ExceptionId))

.BindTo(Model)

.DataBinding(dataBinding => dataBinding.Ajax().Select(

 

"GridSelect", "Results"

))

 

.Columns(column =>

{

    column.Bound(model => model.ColumnOne);

    column.Bound(model => model.ColumnTwo);

    column.Bound(model => model.ColumnThree);

 

 

 

})

 

 

 

 .Scrollable(s => s.Height(300))

 .Selectable()

 

 

 

 .Render();%>

 

 

</div>

 

or should I use the HtmlAttributes method and attempt to add the style direct that way???

In ASP.NET I could capture the onDataBound event and set the row properties of the Grid Control to do this. Being new to MVC, would it be wrong to attempt the same methodology. E.g. Assign a ClientEvent to get the OnRowDataBound event and pass it to javascript to set the row height. Is this possible???

Any help is greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Mark
Top achievements
Rank 1
answered on 10 Jun 2011, 06:17 PM
Nevermind this post. I found the answer to my question via the RowAction mehtod as per the documentation.
http://demos.telerik.com/aspnet-mvc/grid/customformatting

I somehow missed this earlier.

But it doesn't resolve the problem I am seeing with the controller so I will open another post to address that.

Thx

Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Mark
Top achievements
Rank 1
Share this question
or