如何在TabFtem上将控件设置为默认值,然后单击WPF中的另一个TabItem [英] How to set Controls on TabItem to default values on Clicking on another TabItem in WPF

查看:324
本文介绍了如何在TabFtem上将控件设置为默认值,然后单击WPF中的另一个TabItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows加载时,我将数据绑定到tabItem1和tabItem2中的datagrids。



datagridheader有复选框,行也有复选框,检查和取消选中的功能工作正常。



现在在TabItem1中选择后,如果我单击TabItem2然后转到TabItem1(更改同样没有显示defualt datagrid)我怎样才能实现这一点?



在tabitem更改时,应将之前的tabitem设置为默认值。我是WPF的新人



提前感谢

On windows load ,I am Binding data to datagrids in tabItem1 and tabItem2.

the datagridheader has checkbox and row also have checkbox ,the functionality of checking and unchecking working fine.

Now after selection in TabItem1,if i click the TabItem2 and then go for TabItem1(the changes are same not showing defualt datagrid) How can i achieve this?

On tabitem change it should set the previous tabitem to default values. Im new in WPF

thanks in advance

推荐答案

void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    if (e.Source is TabControl)
    {
      //do work when tab is changed
    }
}







你应该在逻辑上设置默认值。希望这会有所帮助。




You should put you logic to set the default values here. Hope this helps.


这篇关于如何在TabFtem上将控件设置为默认值,然后单击WPF中的另一个TabItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆