wpfdatagrid - getting datagridrow of datagrid in WPF -


i used line in code not give row object, row null.

datagridrow row =     (datagridrow)dtgsensorreadinglist.itemcontainergenerator.containerfromitem(channelgrid.items[i]);  

datagrid xaml code:

<datagrid visibility="hidden" virtualizingstackpanel.virtualizationmode="standard"      canuseraddrows="false" columnheaderheight="32" mincolumnwidth="65"      horizontalgridlinesbrush="darkkhaki" verticalgridlinesbrush="darkkhaki"      borderbrush="darkkhaki" block.textalignment="center" autogeneratecolumns="true"      canuserresizecolumns="false" canuserreordercolumns="false" horizontalalignment="left"      margin="63,540,0,0" name="dtgsensorreadinglist" itemssource="{binding}" grid.row="1"      height="auto" verticalalignment="top" maxwidth="1920" width="auto">     <datagrid.resources>         <style targettype="{x:type datagridcolumnheader}">             <setter property="background" value="steelblue" />             <setter property="foreground" value="white" />             <setter property="horizontalcontentalignment" value="center"/>         </style>         <style targettype="{x:type datagridrowheader}">             <setter property="background" value="transparent" />         </style>         <style x:key="body_content_datagrid_centering" targettype="{x:type datagridcell}">             <setter property="template">                 <setter.value>                     <controltemplate targettype="{x:type datagridcell}">                         <grid background="{templatebinding background}">                             <contentpresenter verticalalignment="center" />                         </grid>                     </controltemplate>                 </setter.value>             </setter>         </style>     </datagrid.resources> </datagrid>  

please let me know how can datgridrow ?

if want selected row can bind selecteditem in datagrid.

please tell wanna achieve.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -