在WPF中获取DataGridTemplateColumn模板定义的内容控件
2020-12-13 14:21
                        
 标签:des   style   blog   http   io   color   sp   strong   on    xaml格式描述: 
            
              
                    
                        
                            
                                
                            
                        
                    
                
            
        
现在要获取expander控件,代码如下:
int index = dataGrid.CurrentCell.Column.DisplayIndex;
转载:http://blog.sina.com.cn/s/blog_541e699d0100wjs9.html
DataGridTemplateColumn templeColumn = dataGrid.Columns[index] as DataGridTemplateColumn;
if(templeColumn == null) return;
object item = dataGrid.CurrentCell.Item;
FrameworkElement element = templeColumn.GetCellContent(item);
Expander expander= templeColumn.CellTemplate.FindName("expander", element);
在WPF中获取DataGridTemplateColumn模板定义的内容控件
标签:des style blog http io color sp strong on
原文地址:http://www.cnblogs.com/qq247039968/p/4062440.html
上一篇:C#操作XML
文章标题:在WPF中获取DataGridTemplateColumn模板定义的内容控件
文章链接:http://soscw.com/essay/34004.html