Silverlight 4 DataGrid border around a column -


i haven't been able find anyway dynamically add border around column in silverlight datagrid. here xaml of datagrid:

<sdk:datagrid x:name="plannedandbookedmonthlytable" itemssource="{binding}" autogeneratecolumns="false" margin="5,0,5,5">    <sdk:datagrid.columns>       <sdk:datagridtextcolumn x:name="monthlyheadername" header="" binding="{binding seriesname}" />       <sdk:datagridtextcolumn x:name="monthlyheaderjan" header="jan" binding="{binding janvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheaderfeb" header="feb" binding="{binding febvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheadermar" header="mar" binding="{binding marvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheaderapr" header="apr" binding="{binding aprvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheadermay" header="may" binding="{binding mayvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheaderjun" header="jun" binding="{binding junvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheaderjul" header="jul" binding="{binding julvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheaderaug" header="aug" binding="{binding augvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheadersep" header="sep" binding="{binding sepvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheaderoct" header="oct" binding="{binding octvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheadernov" header="nov" binding="{binding novvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheaderdec" header="dec" binding="{binding decvalue}" />       <sdk:datagridtextcolumn x:name="monthlyheadertotal" header="total" binding="{binding total}" />    </sdk:datagrid.columns> </sdk:datagrid> 

this effect want accomplish:

alt text

how set border on column of data depends on current calendar month is?

each row in datagrid template, each cell. normal datagrid has no concept of cells , current cell positions, selected rows.

if able enough positional information overlay border on datagrid, debugger shows me there not enough information available in datagrid calculate position of current selected cell.

one possible option

the way can think of doing datagrid catching focus events on individual cell controls (e.g. textboxes in datagrid) , use position of selected control relative parent work out border position. each column need templated column can hook gotfocus events.

otherwise...

...you need try different sort of control result seeking.

you use plain old grid, e.g. full of textbox controls, need handle selection , keyboard navigation of grid yourself.

if budget permits, around 3rd party spreadsheet control silverlight. otherwise see if has built 1 on codeplex or elsewhere.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -