how to set the grid row height

2 Answers 1981 Views
General Discussions
Kashim
Top achievements
Rank 1
Kashim asked on 14 Dec 2011, 05:34 PM
can some one tell me how to set the grid row height? thanks 
I tried using a row template but doesn't work.

<script id="rowTemplate" type="text/x-kendo-tmpl">
            <tr style="height=10px">
                <td> etc


also tried
$("#grid").kendoGrid({
                columns: [
                    { title:"col1", field: "COL1", width: 100, height:10 },

thank in advance

2 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 15 May 2012, 12:15 AM
this is all the documentation gives, but it it for the entire table, which isn't very useful. 
$("#grid").kendoGrid({

                columns: [
                    {    title:"col1",
 field: "COL1",
 width: 100 },
 
height:200]
});

I found that the best way is to do it in css:
.k-grid tbody tr{height:38px;}
Kashim
Top achievements
Rank 1
commented on 15 May 2012, 08:27 AM

Thanks but that hasn't worked for me.

I'm sure i'll find the answer but at the moment the problem is gone down on my 'things to do' list
0
Andrew
Top achievements
Rank 1
answered on 15 May 2012, 01:31 PM
There is also some padding on 'td' that will prevent the rows from being thinner unless you remove it. It is set in kendo.common.min.css
Sree Rachakonda
Top achievements
Rank 1
commented on 31 Aug 2012, 08:47 AM

Thanks a tonne Andrew... your tip worked like charm.

this is how i have given:
.k-grid td
{
    padding: 0.1em 0.1em
}

Cheers
Leo
Top achievements
Rank 1
commented on 16 Feb 2013, 01:59 PM

I think I am starting to love kendo. Thanks guys :)
Odd Veibust
Top achievements
Rank 1
commented on 13 Feb 2014, 06:21 AM

Thanks for the tip Andrew, works like a charm!
Binny
Top achievements
Rank 1
commented on 21 Jul 2014, 10:50 AM

Hello Telerik,


One of the column in my Kendo grid is the Notes Column (which has atleast 3000 characters). 

Now the problem I'm facing is the grid cell expands to the size of the characters. It makes my cell huge.

I would like to make the grid cell single line with a fixed amount of characters and have a tooltip on the cell.

I'm not sure whether I can achieve it. 

Please let me know the possible solution for the above case.

Sample data in a cell  in  the Column (Notes):


<div><b>17/11/2010</b> - Not received many enquiries, uses Extra Sure and Holmans. Finds our Medical Screening too lengthy. Took her through system and printed off Mes Screen questions, will use us more than N J Heritage. She will aim to use us for new enquiries.</div><div><br></div><div><b>16/02/11</b> - L/M - R/C.</div><div><br></div><div><b>08/03/2011</b> - JCO - Spoke to Matthew Salmon, not finding us competitive been using ExtraSure who are a lot cheaper. Advised our USP's and our benefits. Will use us for next travel enquiry.</div><div><b><br>16/06/11</b> - Jane spoke to Richard and will be taking him through the system, SunWorld Plus.</div><div><br></div><div><b>12/10/11</b>-I Have spoken to Richard, I have emailed across details of Sunworld Extra &amp; medical screening along with Username &amp; Password. MP</div><div><br></div><div><b>01/11/2011 </b>- JCO spoke to Richard, Richard issuing a quotation today, likes that we don't have any age limits and restricted to 85 on AMT policies. &nbsp;First time to use us, usually use Citybond, likes the look of our product. JCO advised to contact me if requires detailed explanation of system.&nbsp;</div><div><br></div><div><b>25/05/12</b> - MW - Spoke to Richard, he is very nice, I thanked them for their continued support in using SunWorld and I am sending him the email with the Special Features and the SunWorld Extra info.. He said he rates SunWorld 8 and a half out of ten because he would like to see the option to increase the single article limit and also the rates have gone up quite a bit recently.. He said they don't really do that much travel but they are going to be pushing it over the next year because he said he thinks people are getting fed up of going on the internet to get insurance and realising they aren't actually covered for anything... He is generally happy with everything.</div><div><br></div><div><b>08/08/12</b> - MW - Spoke to Luke, I asked why they hadn't used us since June and he said it was just because of a slow down in enquiries. &nbsp;Travel is not something they push, they just offer it to accommodate their existing clients. &nbsp;He said the only use us and one other provider so any enquiries they do get they always quote with us, he has done some quotes this week but they haven't come back. &nbsp;They are very happy with everything. &nbsp;No problems etc. &nbsp;I am sending him the Special Features for 2012 and also SunWorld Extra info,</div><div><br></div><div><b>16/08/12</b> - MW - Spoke to Richard, asked if they would be interested in having a <span class="wysiwyg-color-red"><b>poster</b></span>, he said it would not really be of any use to them as they are not a high street broker, they are in an office and not customer facing, he said they don't really do much travel, they are mainly a commercial broker but they are happy with any travel business they can do, what they would like is a flyer as opposed to a poster so they can email it out to their customers. &nbsp;He said he thinks the product is great, likes the age limits and limits etc,<br><br><b>14/11/12 -&nbsp;</b>MW - Spoke to Luke, told him about <span class="wysiwyg-color-green"><b>Snowman Cover</b></span> and Broker <span class="wysiwyg-color-blue"><b>Survey</b></span>.<br><br><b>04/12/12</b> - MW - Spoke to Luke, he said they are really quiet at the moment. &nbsp;Only using SunWorld but just not getting the enquiries. &nbsp;he is happy with SunWorld though and I have told him about the <b>Changes for 2013.<br></b><br><b>08/02/13</b> - MW - I can see that they said back in August that they would like some leaflets so I am sending them some out.<br><br><b>28/02/13</b> - MW - Luke has sent this email &nbsp;- "Sorry, not sure if you are still doing this but can we havesome leaflets to send with our renewals to try and offer your services J thanks" , So I am sending them out some more leaflets.<br><br><b><span class="wysiwyg-color-yellow">01/05/13</span> -&nbsp;</b>MW - Spoke to Richard, he said the main person who does the travel, Luke, is on holiday in Turkey for the rest of the week and will be back on Tuesday. &nbsp;I have made a note in my diary to give him a call back on Wednesday.<br><br><b><span class="wysiwyg-color-yellow">08/05/13</span></b> - MW - Spoke to Luke, he said SunWorld are their main travel provider, they have not really had many enquiries for travel lately. &nbsp;He said our rates are competitive for annual but people can get travel insurance so cheap online now that he thinks they have just been doing that. &nbsp;I said we will reduce the rates for him and he said that would be good. &nbsp;They are also set up to use us via the AXA route which he said is fine to be deactivated and they will carry on using this one as they have been. &nbsp;He said he would like some leaflets as he never received the last lot so I have checked his address and I am sending out 20 more. &nbsp;I told him about the new product and I am sending him the email with the Underwriting Changes and Special Features for 2013. <span class="wysiwyg-color-red"><b>RATES REDUCED<br></b></span><br><b><span class="wysiwyg-color-yellow">01/07/13</span></b> - MW - Spoke to Luke, he said they are only using SunWorld so they must have not had any enquiries and that's why they haven't used us in the last month. &nbsp;He said they only really offer travel insurance to accommodate their existing clients, they don't really push for it. &nbsp;He said they have got the leaflets and they will be sending them out with renewals etc. &nbsp;As soon as they get the enquiries, we will be getting the business.<br><br><b><span class="wysiwyg-color-green">13/09/13</span></b> - MW - Spoke to Richard, told him about the new product going live on the 1st October. &nbsp;I am sending him the email with the Underwriting Changes and Special Features for 2013. &nbsp;He said they would like some leaflets so I have confirmed their address and I am sending out 20.<br><br><b><span class="wysiwyg-color-yellow">01/11/13</span><span class="wysiwyg-color-green">&nbsp;</span> -&nbsp;</b>MW - Spoke to Richard, he said they are very quiet at the moment, their customers are not going away and that's why they haven't issued anything. Luke is the main person who deals with this and he will be our contact going forward because he is the one who deals with it most of the time. &nbsp;I told Richard about the video tutorial and he is going to tell Luke and he will let us know if he has any queries. &nbsp;I am sending the email with the New Special Features and further information on the changes we have made to the website. luke.robson@aifltd.co.uk<br><br><b><span class="wysiwyg-color-yellow">02/01/14</span> -&nbsp;</b>MW - Spoke to Luke, I have confirmed all the contact information is correct and I have added his email address to the spreadsheet for the 2014 mailer and then he will forward it around to all the others. &nbsp;He said they only use SunWorld and it is the easiest to use, they just haven't had any enquiries for travel. &nbsp;I am sending him the email with the New Special Features and information about the changes we have made to the system. &nbsp;He said he has asked for some leaflets before but he has not received them. &nbsp;He really wants some to send out with all his renewals so I am sending him out 60 leaflets.<br><br></div>
Dimo
Telerik team
commented on 23 Jul 2014, 01:13 PM

Hi Binny,

In order to achieve the desired behavior, you need the following:

1. A white-space:nowrap style for the Notes column's cells. Use a custom column attribute to apply it - an inline CSS style or a CSS class (better).

http://docs.telerik.com/kendo-ui/api/web/grid#configuration-columns.attributes

2. A table-layout:fixed style for the Grid table. If Grid scrolling is enabled, the style is already applied. Otherwise, use

http://docs.telerik.com/kendo-ui/getting-started/web/grid/walkthrough#column-widths

3. An overflow:hidden and text-overflow:ellipsis styles for the Notes column's cells. If Grid scrolling is enabled, these styles are already applied. Otherwise, use the a column attribute, as shown above.

4. The tooltip can be added as a title column attribute, and you can also extend the behavior to use a Kendo UI Tooltip.

http://demos.telerik.com/kendo-ui/tooltip/index

http://docs.telerik.com/kendo-ui/getting-started/web/tooltip/overview

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Kashim
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Share this question
or