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> 

this generate tab : enter image description here

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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -