首页 \ 问答 \ WPF DataGrid ItemsSource绑定Linq(WPF DataGrid ItemsSource Binding Linq)

WPF DataGrid ItemsSource绑定Linq(WPF DataGrid ItemsSource Binding Linq)

这是我的问题。 我有一个WPF数据网格,我将.ItemsSource绑定到linq查询IEnumerable结果。 这很好用。 当我运行程序时,数据正确地加载到数据网格中。 我的问题是显示的数据太多。 (IE用户不需要查看ID字段等)。 我试图做的是在绑定到.ItemsSource后,我想隐藏几列。 我找到了.Visibility并试图设置它,但是columns对象是空的。 在绑定之后,我尝试了以下方法:.Items.Refresh()和.UpdateLayout()。

我的问题是,在设置.ItemsSource后,我需要调用什么方法来刷新列?


Here is my problem. I have a WPF datagrid and I am binding the .ItemsSource to a linq query IEnumerable result. This works great. When I run the program the data is loaded correctly in the datagrid. My problem is too much data is displayed. (IE users don't need to see ID fields, etc). What I am attempting to do is after I bind to the .ItemsSource, I want to hide a few columns. I have found the .Visibility and attempting to set it, but the columns object is empty. After the binding I have tried the following methods: .Items.Refresh() and .UpdateLayout().

My question is what method do I need to call to refresh the columns after I set the .ItemsSource?


原文:https://stackoverflow.com/questions/7930213
更新时间:2021-09-18 19:09

最满意答案

问题是我在我的Info.plist(应用程序提供的字体)中列出了一个不属于应用程序包的字体。


The issue was that I was listing a font in my Info.plist (Fonts provided by application) that was not part of the application bundle.

相关问答

更多
  • 不幸的是, lldb有点不稳定,似乎是你的案例中崩溃的原因。 切换到gdb可能导致这些崩溃消失。 Unfortunately lldb is somewhat unstable and appears to be the cause of the crashes in your case. Switching to gdb can cause these crashes to go away.
  • 我发现这个问题,不知何故,在我的XCode中启用了“调试时显示反汇编”,这就造成了这个问题。 当我禁用它时,我的所有调试器停在我的源代码中。 您可以在调试时在产品 - >调试工作流程 - >显示反汇编下找到它 编辑 在最新的XCode中,它在Debug-> Debug Workflow-> Show Disassembly时被调试 I found the problem, Somehow the "Show Disassembly when debugging" was enabled in my XCod ...
  • 问题是我在我的Info.plist(应用程序提供的字体)中列出了一个不属于应用程序包的字体。 The issue was that I was listing a font in my Info.plist (Fonts provided by application) that was not part of the application bundle.
  • 解决方案是这篇文章: Xcode中的子项目 基本上,对于每个依赖项,您必须创建一个静态库目标,并在“构建阶段”下的依赖项目中引用该目标。 GOTCHA 1:类别对我来说不是开箱即用的。 为了解决这个问题,我需要转到引用库的父项目 - >目标 - >构建设置 - >其他链接器标志=“ - ObjC”。 GOTCHA 2:您导入的标题可能会出现“找不到文件”错误。 您需要将Angle Brackets用于库中的标题,例如 #import 以及在父项目的“标题搜索路径”中包含库 ...
  • 这不是断点,而是视图控制器中的一个例外(其名称在此处部分编辑)。 单击堆栈跟踪中的第二个项目,它将显示有问题的行。 只需上升堆栈跟踪,直到找到自己的代码。 很难根据这么少的信息来判断,但是看看堆栈跟踪,显示的汇编代码和异常,看起来你在一个转换失败的segue期间遇到了问题。 也许有一个prepareForSegue方法试图将segue.destinationViewController转换为特定的视图控制器类,以便将一些数据传递到目标,但是由于某种原因,转换失败了。 也许您忽略了在故事板中为目标场景设置基类 ...
  • 使用Xcode断点设置无法做到这一点。 您可以在lldb中使用C ++异常断点上的Python断点命令执行此操作。 您的回调会将堆栈查找到抛出异常的位置,并检查抛出代码是否在您的共享库中,并从断点自动继续。 该部分: http://lldb.llvm.org/python-reference.html 在遇到断点时运行脚本将为您提供有关如何执行此操作的一些详细信息。 例如,你可以把: module_name = "TheNameOfYourExecutableOrSharedLibrary" def bkp ...
  • 你想要的是一个观察点(见这里的 “设置观察点”)。 基本上,它们监视内存以进行写入,并在发生这种情况时中断程序。 我认为你只能从调试控制台而不是Xcode UI中设置它们: (lldb) watchpoint set variable myinstancevar 要么 (lldb) w s v myinstancevar What you want is a Watchpoint (see "Setting Watchpoints" here). Basically they monitor memor ...
  • 似乎没有办法在Xcode Breakpoint Navigator中按编号标识断点。 但是,您可以在调试器控制台中轻松删除断点。 在您的情况下,“6”是断点编号,“3”是断点位置之一。 breakpoint list 显示所有断点。 breakpoint delete 6 删除断点6(包含所有位置)。 breakpoint disable 6.3 仅禁用断点6的位置3。 There seems no way to identify the breakpoints by number in the Xc ...
  • 我不认为这是通过Xcode Breakpoints UI公开的,但在lldb中你可以修改一个断点,这样只有在(1)线程名称匹配时才会触发,(2)调度队列名称匹配,(3)线程ID匹配,或者(4)线程索引号匹配。 您可以在创建断点( breakpoint set )时指定这些条件,也可以将这些条件添加到具有breakpoint modify的现有断点。 请参阅调试器控制台窗口中的help breakpoint modify以获取允许的参数列表。 I don't think this is exposed thr ...
  • 打开产品 - >方案 - >编辑方案。 在运行和测试检查构建配置是调试和调试器是LLDB Opened Product->scheme->edit scheme. in Run and test check build configuration is Debug and debugger is LLDB

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)