Wednesday 15 September 2010

c# - FontFamily not being applied on DataGrid Cell -



c# - FontFamily not being applied on DataGrid Cell -

i have sfdatagrid on winrt project, displays contents of excel file. xaml have:

<page.resources> <common:customstyleselector x:key="styleselector"/> </page.resources>

...

<syncfusion:sfdatagrid grid.row="1" x:name="datagrid" width="auto" visibility="collapsed" margin="10,0,10,10" allowresizingcolumns="true" autogeneratecolumns="true" allowdraggingcolumns="true" allowsorting="false" columnsizer="star" rowheight="65" rowstyle="{staticresource rowstyle}" showrowheader="true" cellstyleselector="{staticresource styleselector}" />

and cellstyleselector uses

public class customstyleselector : styleselector { private style cellstyle { get; set; } private static int cellcounter; protected override style selectstylecore(object item, dependencyobject container) { cellcounter = cellcounter + 1; switch (cellcounter) { case 3: case 5: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: cellstyle = application.current.resources["altcustomcellstyle"] style; homecoming cellstyle; default: cellstyle = application.current.resources["customcellstyle"] style; homecoming cellstyle; } } }

and styles using ´

<style x:key="customcellstyle" targettype="syncfusion:gridcell"> <setter property="borderbrush" value="gray" /> <setter property="borderthickness" value="1,0,0,1" /> <setter property="padding" value="0,0,0,0" /> <setter property="foreground" value="#ff2a2a2a" /> <setter property="fontsize" value="13" /> <setter property="fontfamily" value=" segoe ui" /> </style> <style x:key="altcustomcellstyle" targettype="syncfusion:gridcell"> <setter property="background" value="#49e367" /> <setter property="borderbrush" value="gray" /> <setter property="borderthickness" value="1,0,0,1" /> <setter property="padding" value="0,0,0,0" /> <setter property="fontfamily" value=" segoe ui semibold" /> <setter property="fontweight" value="bold" /> <setter property="foreground" value="#ff2a2a2a" /> <setter property="fontsize" value="24" /> </style>

everything seems working, cells im searching in switch #49e367 background, reason fontsize , fontfamily dont changed.

am missing something?

c# datagrid windows-runtime winrt-xaml syncfusion

No comments:

Post a Comment