Tag: listview

在ListView EmptyDataTemplate中查找控件

我有一个像这样的ListView … 在Page_Load()我有以下内容: Literal x = (Literal)ListView1.FindControl(“Literal1”); x.Text = “other text”; 但是x返回null 。 我想更改Literal控件的文本,但我不知道该怎么做。

C#Windows7 / Vista风格ListView

当我在VS2008的详细信息视图中创建ListView时,它会创建一个相当古老的列表视图。 它没有任何花哨的hover效果和酷蓝色边框(例如)WinVista和Win7中的文件浏览器。 见图片例如: 总结一下,如何才能在C#VS2008中获得一个ListView,如上图所示? (VS2008右侧列表视图进行比较) 谢谢

在ListView控件中显示数据表

如何在WPF中的ListView控件中显示DataTable?

C#ListView详细信息,突出显示单个单元格

我在C#中使用ListView来制作网格。 我想找到一种能够以编程方式突出显示特定单元格的方法。 我只需要突出显示一个单元格。 我已经尝试了所有者绘制的子项目,但使用下面的代码,我得到突出显示的单元格,但没有文字! 有没有关于如何使这个工作的想法? 谢谢你的帮助。 //m_PC.Location is the X,Y coordinates of the highlighted cell. void listView1_DrawSubItem(object sender, DrawListViewSubItemEventArgs e) { if ((e.ItemIndex == m_PC.Location.Y) && (e.Item.SubItems.IndexOf(e.SubItem) == m_PC.Location.X)) e.SubItem.BackColor = Color.Blue; else e.SubItem.BackColor = Color.White; e.DrawBackground(); e.DrawText(); }

将ListView导出为CSV

是否有人知道从ListView导出的体面的CSV导出工具? 我需要获得一个项目更新和function蠕变意味着我没有时间自己实现这个最终function。

以编程方式将ListViewItem添加到WPF中的Listview

可能重复: WPF ListView – 如何以编程方式添加项目? 如何在C#中完成?

禁止ListView使所选项目为零

我的项目是.NET / WinForms。 我有一个列表视图,总是填充项目。 我希望它总是有选择。 但是,如果我单击列表视图项下面的空白区域,它将失去选择。 该列表有多个selection = true和hide selection = false。

如何在自定义Xamarin.Forms ViewCell上的行之间添加分隔符空间?

在关于Xamarin论坛的这个问题中, https: //forums.xamarin.com/discussion/20517/curved-corners-in-tableview-cells Craig Dunn教授如何使用框架创建单元格。 我想在每个单元格之间添加一个空格。 目前,细胞似乎是胶合的,而ViewCell没有空间属性。 谢谢!

计算水平偏移以将ListView滚动到SelectedItem的中心

我正在构建一个照片应用程序,使用FlipView和listView作为分页。 当我点击ListView的缩略图时,它会在FlipView显示相同的图片。 当我滑入FlipView ,所选的任何照片都会在ListView选择相同的图片。 这可以通过添加到它们来完成: 到ListView : SelectedIndex=”{Binding Path=SelectedIndex, ElementName=flipView1, Mode=TwoWay} 到FlipView : SelectedIndex=”{Binding Path=SelectedIndex, ElementName=listView1, Mode=TwoWay} 我添加了ListView SelectionChanged事件: if (e.AddedItems.Count > 0) listView1.ScrollIntoView(e.AddedItems.First(), ScrollIntoViewAlignment.Leading); 我唯一的问题是当我滑动FlipView ,在ListView选择了所需的图片,但ScrollViewer没有滚动到它。 我尝试使用WinRTXamlToolkit来更改ScrollViewer的位置: private void pageRoot_Loaded() { // count number of all items int itemCount = this.listView1.Items.Count; if (itemCount == 0) return; if (listView1.SelectedIndex >= itemCount) listView1.SelectedIndex = itemCount – […]

如何在C#中将IEnumerable 转换为List ?

我使用LINQ查询generics字典,然后使用结果作为我的ListView(WebForms)的数据源。 简化代码: Dictionary dict = GetAllRecords(); myListView.DataSource = dict.Values.Where(rec => rec.Name == “foo”); myListView.DataBind(); 我认为这会工作,但实际上它会抛出System.InvalidOperationException : ID为’myListView’的ListView必须具有实现ICollection的数据源,或者如果AllowPaging为true,则可以执行数据源分页。 为了使它工作,我不得不采取以下措施: Dictionary dict = GetAllRecords(); List searchResults = new List(); var matches = dict.Values.Where(rec => rec.Name == “foo”); foreach (Record rec in matches) searchResults.Add(rec); myListView.DataSource = searchResults; myListView.DataBind(); 在第一个例子中是否有一个小问题让它工作? (不知道该使用什么作为这个问题标题,随意编辑更合适的东西)