grid - How to stop Telerik CSS from overriding local changes? -



grid - How to stop Telerik CSS from overriding local changes? -

i have kendo grid , default css background-color or 'text' color display.

i able override background colors lines 1 & 2, however, replaced colors. need to able set color based on "intruck" boolean field.

i tried lines 5 , 6, , html mark correctly updated , see flash right color before reset defaults. have tried adding in !important in rows 3 , 5, still no luck. seems setting style after done using kendo/telerik css. how stop that?

<style> 1 /*.k-grid-content>table>tbody>tr{background-color:lightgreen;}*/ 2 /*.k-grid-content>table>tbody>.k-alt{background-color:red;}*/ 3 .in{color:lightgreen;} </style> <div id="divsearchresults"> @(html.kendo().grid((ienumerable<models.searchresult>)model.searchresults) 4 // .events(ev => ev.databound("grid_onrowdatabound")) 5 // .rowaction(row => { if (row.dataitem.intruck) row.htmlattributes["style"] = "background-color:lightgreen"; else row.htmlattributes["style"] = "background-color:red !important"; }) .name("grid") 6 .rowaction(row => { if (row.dataitem.intruck) { row.htmlattributes["class"] = "in"; } }) .datasource(ds => ds.ajax() .pagesize(constants.maxsearchreults) .model(mod => { mod.id(m => m.id); mod.field(p => p.name).editable(false); mod.field(p => p.carriercode).editable(false); mod.field(p => p.citystate).editable(false); mod.field(p => p.phone).editable(false); })) .columns(columns => { columns.template(@<text></text>).clienttemplate("<input type='checkbox' #= isselected ? checked='checked':'' # class='chkbx' value='#= carrierid#' name='selectedarea' />") .headertemplate("<input type='checkbox' id='mastercheckbox' onclick='checkall(this)'/>").width(20); columns.bound(p => p.name).filterable(false).width(100); columns.bound(p => p.carriercode).filterable(false).width(75); columns.bound(p => p.citystate).filterable(false).width(100); columns.bound(p => p.phone).filterable(false).width(75); }) .editable(ed => ed.mode(grideditmode.incell)) .pageable() .sortable() .scrollable() .filterable() ) </div>

i never did figure out how wanted, however, solution has same results , think looks improve , easier on eyes asked for. set color behind checkbox there obvious color difference isn't gaudy.

.columns(columns => { columns.template(@<text></text>) .clienttemplate("<span style='float:left; width:100%; background:#= intruckmate ? \"lightgreen\" : \"palevioletred\"#'><input type='checkbox' #= isselected ? checked='checked':'' # class='chkbx' value='#= carrierid#' name='selectedarea' /></span>") .headertemplate("<input type='checkbox' id='mastercheckbox' onclick='checkall(this)'/>") .width(25); columns.bound(p => p.name).filterable(false).width(100);

grid telerik asp.net-mvc-5

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -