使用WebClient(C#.NET)时设置expect100continue的最佳方法是什么.我在下面有这个代码,我仍然看到标题中有100个继续.愚蠢的apache仍抱怨505错误.
string url = "http://aaaa.com";
ServicePointManager.Expect100Continue = false;
WebClient service = new WebClient();
service.Credentials = new NetworkCredential("username", "password");
service.Headers.Add("Content-Type","text/xml");
service.UploadStringCompleted += (sender, e) => CompleteCallback(BuildResponse(e));
service.UploadStringAsync(new Uri(url), "POST", query);
Run Code Online (Sandbox Code Playgroud)
注意:如果我将上述内容放在控制台应用程序中并让它运行 - 那么我在fiddler中看不到标题.但是,我的代码嵌入在由WPF应用程序加载的用户库中.那么,在线程,初始化等方面还有更多的Expect100Continue.现在,我认为这更多是我的代码问题.
如何根据可见行数设置datagridview的高度.假设我有一个带数据源的datagridview,有100行.我希望可视区域只显示10行.可以通过滚动查看其他行.
我正在使用WPF Toolkit DataGrid和DataGridComboBoxColumn.一切都运行良好,除了在组合框中发生选择更改时,所选的值绑定源不会立即更新.仅当组合框失去焦点时才会发生这种情况.有没有人遇到过这个问题和任何建议解决方案?
这是该列的xaml:
<toolkit:DataGridComboBoxColumn Header="Column" SelectedValueBinding="{Binding Path=Params.ColumnName, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="cName"
SelectedValuePath="cName">
<toolkit:DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding Info.Columns}" />
</Style>
</toolkit:DataGridComboBoxColumn.ElementStyle>
<toolkit:DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding Info.Columns}" />
</Style>
</toolkit:DataGridComboBoxColumn.EditingElementStyle>
</toolkit:DataGridComboBoxColumn>
Run Code Online (Sandbox Code Playgroud)