WPF 中获取DataGrid 模板列中控件的对像

 

  #region 当前选定行的TextBox获得焦点
        /// <summary>
        /// 当前选定行的TextBox获得焦点
        /// </summary>
        public void SelectedRowTBFocus()
        {
            if (SelectIndex != -1)
            {
                FrameworkElement item = grid.Columns[6].GetCellContent(grid.Items[SelectIndex]);
                DataGridTemplateColumn temp = (grid.Columns[6] as DataGridTemplateColumn);
                SelectTB = temp.CellTemplate.FindName("FinCode", item) as TextBox;
                SelectTB.Focus();
            }
        }
        #endregion
获取当前选定行的TextBox对象

相关文章:

  • 2022-12-23
  • 2021-10-31
  • 2021-08-30
  • 2021-09-14
  • 2021-11-19
  • 2021-06-23
  • 2022-02-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-01-07
  • 2021-09-22
相关资源
相似解决方案