由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
DotNet版 - Please help me with Infragistics XamDatagrid databinding
相关主题
请教一个report viewer loading performance 的问题看看这个
textbox and radiobuttonlistsql server reporting services 的publish问题
dynamic change before refreshingCarlosAg.ExcelXmlWriter 的问题
Nested Datalist layout!!好像NHibernate很popular。。。。。。
using weather XML feed in C# - 1asp.net随机排列,怎么分页
how to generate table in visual C#add web service
datagrid helpdrawing in c#
How to Call Stored Procedure in C# .Net?Jquery dialog问题请教
相关话题的讨论汇总
话题: igdp话题: name话题: field话题: code
进入DotNet版参与讨论
1 (共1页)
C********r
发帖数: 145
1
Sorry, I have no Chinese software on this machine...
I am new to WPF and Infragistics Controls. I am trying to accomplish a
seemly simple task. use Xamdatagrid to display a collection of data records
retrieved from database.Besides the columns from the data records, I want an
additional unbounded column to contain a checkbox. I am having a really
hard time to get the databinding to work. I have spend 2 days to look up
examples and tutorials but none are complete or easy to understand(for me at
least). If I just set the datasource in the code behind and set
autogeneratecolumn to true, it works ok. But that's not what I need, I need
to control which field is visible in the grid and also add the checkbox
column. When I run the code below, I can see data is available but the
datagrid is blank. I think it's because I didn't specify binding of the
columns between the grid and datasource. But what's the syntax to do this
explicitly for XAMDatagrid? Please help me to see what I have done wrong in
code below and what I haven't done to get the desired behavior. I have no
BAOZI but sincere appreciation...
Omitted some style definition in the markup below:
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"
xmlns:c="clr-namespace:POAPopup"
xmlns:igDP="http://infragistics.com/DataPresenter"
mc:Ignorable="d"
d:DesignHeight="326" d:DesignWidth="410" SizeToContent="
WidthAndHeight" Loaded="Window_Loaded" >








AllowDelete="False" AllowAddNew="False" HighlightAlternateRecords="True" />




="60" >

"{StaticResource CheckBoxInCellStyle}" />


Visibility="Collapsed" " />
Tag="{Binding Path=Code}" />

Width="280" />






Code behind for the dataprovider
public class POADataProvider
{
ObservableCollection _HICollection = new
ObservableCollection();
public ObservableCollection HICollection
{
get { return _HICollection; }
set { _HICollection = value; }
}
public ObservableCollection GetHICollection()
{
//omitted code to connect to DB and query data and add to _
HICollection
return _HICollection;
}
}
L******e
发帖数: 136
2
is your binding source an observable collection? it has to be obserbable
collection for infragistics xamdatagrid
for syntax google "infragistics binding object/s"
d***m
发帖数: 11
3
Haven't use Xamdatagrid but normally you binding the data source(a
collection) to DataSource not DataContext.
DataContext="{Binding Source={StaticResource POAObjs}}"

records
an
at
need

【在 C********r 的大作中提到】
: Sorry, I have no Chinese software on this machine...
: I am new to WPF and Infragistics Controls. I am trying to accomplish a
: seemly simple task. use Xamdatagrid to display a collection of data records
: retrieved from database.Besides the columns from the data records, I want an
: additional unbounded column to contain a checkbox. I am having a really
: hard time to get the databinding to work. I have spend 2 days to look up
: examples and tutorials but none are complete or easy to understand(for me at
: least). If I just set the datasource in the code behind and set
: autogeneratecolumn to true, it works ok. But that's not what I need, I need
: to control which field is visible in the grid and also add the checkbox

1 (共1页)
进入DotNet版参与讨论
相关主题
Jquery dialog问题请教using weather XML feed in C# - 1
[转载] 问一个javascript 和 .NET 的问题how to generate table in visual C#
how they did elgooGdatagrid help
[转载] ToolTip in C#How to Call Stored Procedure in C# .Net?
请教一个report viewer loading performance 的问题看看这个
textbox and radiobuttonlistsql server reporting services 的publish问题
dynamic change before refreshingCarlosAg.ExcelXmlWriter 的问题
Nested Datalist layout!!好像NHibernate很popular。。。。。。
相关话题的讨论汇总
话题: igdp话题: name话题: field话题: code