c# - PRogrammaticaly Add ContentTemplate to TabControl -
while may seem trivial, i'm having hard time it.
i have tabcontrol
<tabcontrol x:name="tcprovince" margin="2" itemssource="{binding path=workingentity.rates.codebyprovincecollection, mode=oneway}" selectionchanged="tcprovince_selectionchanged" > <tabcontrol.contenttemplate> <datatemplate> <max:maxgrid> <max:maxgrid.rowdefinitions> </max:maxgrid.rowdefinitions> <max:maxgrid.columndefinitions> </max:maxgrid.columndefinitions> </max:maxgrid> </datatemplate> </tabcontrol.contenttemplate> </tabcontrol>
then inside of each tab want create dynamic grid :
+-------+-------+--------+-------+ | 2016 | 2017 | 2018 | 2019 | +-------+-------+--------+-------+ | xxx | xxxx| xxxx | xxxxx | +-------+-------+--------+-------+
the year
, xxx
value entered customer. add yeah has click on button, , xxx
textbox input can edit anytime. have no idea how many year , value get.
my pseudo code bit : - on tabcontrolselectionchange - if grid has been generated, display it.
- otherwise :
- grab datatemplate (or create new one, doesnt matter)
- generate columns according collection
- insert values in cells
- create binding
textbox
- push new grid tabitem
i have every tools this. can figured out, how set new grid content of tabitem, since tabitem type of collection's content
Comments
Post a Comment