我的Datagrid对ObservableCollection有一个绑定,并在对EF提取的一些值进行分组后得到填充.
我的问题是,datagrid-height超出了窗口大小.有谁知道如何解决这个问题...我几乎用谷歌搜索死了......:o
<UserControl x:Class="UltranizerV2.Views.Storage.InventoryList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="25"></RowDefinition>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" >
<DataGrid ItemsSource="{Binding PresentableInventoryItems}" VerticalAlignment="Stretch" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Produkttitel" Width="350" Binding="{ Binding ProductTitle}"/>
<DataGridTextColumn Header="Sku" Width="100" Binding="{ Binding Sku}" />
<DataGridTextColumn Header="Menge" Width="60" Binding="{ Binding Quantity}" />
</DataGrid.Columns>
</DataGrid>
</DockPanel>
<Label Grid.Row="1">Arsch</Label>
</Grid>
</UserControl>
Run Code Online (Sandbox Code Playgroud) 我对Any-Operator有疑问.
在Technet上它说
例如,以下查询查找位于未被任何销售人员覆盖的区域中的客户.
Use AdventureWorks2008R2;
GO
SELECT
CustomerID
FROM
Sales.Customer
WHERE
TerritoryID <> ANY
(
SELECT
TerritoryID
FROM
Sales.SalesPerson
);
Run Code Online (Sandbox Code Playgroud)
进一步
结果包括所有客户,但销售区域为NULL的客户除外,因为分配给客户的每个区域都由销售人员承保.内部查询查找销售人员所涵盖的所有销售区域,然后,对于每个区域,外部查询查找不在一个区域内的客户.
但该查询返回所有客户.我将客户TerritoryID更新为没有sales.person的值,但该查询仍返回所有客户,而不是我期望的客户.
我错过了什么吗?可能那篇关于technet的文章完全错了吗? https://technet.microsoft.com/de-de/library/ms187074 ( v= sql.105) .aspx(德语)
有一个客户的TerritoryID = 13
内部查询结果(SELECT TerritoryID FROM Sales.SalesPerson):4 2 4 3 6 5 1 4 6 1 1 6 9 1 8 10 7
在表中,Sales.Customer是CustomerID = 13的行,这是销售人员未涵盖的行.
我是WebForms的新手,我想我有一个相当简单的问题.我经常看到人们在他们的页面类的page_load方法中初始化任何类型的依赖项.这是常见的事吗?
我通常会在构造函数中编写的东西.
我如何确定构造函数中的内容以及page_load处理方法中最好的位置
我正在尝试为计算机上的每个hdd卷获取各种属性.
我正在使用cmdlet get-volume,然后通过它foreach,但Windows Server 2008中不存在该cmdlet.:(
有人知道另一种选择吗?
我只需要驱动器号,objectId/guid,可用空间,总空间和每个卷的名称.
我在这里对多线程感到非常困惑:(我正在阅读关于C#Async/Await关键字.我经常读到,通过使用这个异步功能,代码被执行"非阻塞".人们将代码示例分为两类" IO-Bound"和"CPU绑定" - 我执行io-bound时我不应该使用线程,因为该线程只会等待..
我不明白......如果我不想让用户等待操作,我必须在另一个线程上执行该操作,对吧?
如果我使用Threadpool,一个"Thread"-class,delegate.BeginInvoke或TPL的实例 - 每个异步执行都在另一个线程上完成.(有或没有回调)
想象一下以下方法.
public async Task<IHttpActionResult> Get(int id)
{
List<PageVirtualServer> pageVirtualServer = await context.PageVirtualServer
.Where(z => z.StatusPageId == id)
.ToListAsync();
List<StatusMessage> messages = await context.StatusMessages
.Where(x => pageVirtualServer.Any(
y => y.VirtualServerId == x.VirtualServerId))
.ToListAsync();
return Ok(messages);
}
Run Code Online (Sandbox Code Playgroud)
发生以下异常.."无法创建类型'xy'的常量值.在此上下文中仅支持基本类型或枚举类型."
但是当第一个查询嵌入第二个时 - 它确实有效,我不明白.
为什么这种方法有效,但第一种方法不起作用?
public async Task<IHttpActionResult> Get(int id)
{
List<StatusMessage> messages = await context.StatusMessages
.Where(x =>
context.PageVirtualServer
.Where(z => z.StatusPageId == id)
.Any(y => y.VirtualServerId == x.VirtualServerId))
.ToListAsync();
return Ok(messages);
}
Run Code Online (Sandbox Code Playgroud)
有人可以解释这种行为吗?
c# ×3
asp.net ×1
asynchronous ×1
datagrid ×1
linq ×1
powershell ×1
scrollbar ×1
sql-server ×1
webforms ×1
windows ×1
wpf ×1