本文介绍了使用Silverlight如何根据ID在DataGrid中显示名称,部门的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是哪一个等于仅在网格视图中显示的StuentDetails表.例如,在StudentName表中,我有2条记录,即StudentID = 1,StudentName = a; StudentID = 2,StudentName = b;在DepartmentTable中,我有2条记录,即DepartmentID = 1,DepartmentName = a; DepartmentID = 2,部门名称= b;在StudentDetailsTable中,我有一个记录,即StudentName = 1,部门= 1;在我的DataGrid中,当数据网格将显示时,我连接StudentDetailsTable,其显示如下,即StudentName = a ,, Department = a;

我有2个组合框(名称,部门)名称组合框包含来自StudentNameTable的数据,其显示路径=名称,选定值的路径= ID,部门组合框包含来自部门表的数据,显示路径=名称,选定值的路径= ID,这两个组合框值存储在学生详细信息表"中...在学生详细信息表"中,它仅包含StudentID,DepartmentId....

我的问题是当我使用数据网格显示学生详细信息表时,它仅显示ID,我要显示StudentName,而DepartmentName表示我该怎么做

My Question is Which One is Equal To StuentDetails Table That only Displayed in Grid ViewFor Ex..In StudentName Table i have 2 records That is StudentID=1,StudentName=a; StudentID=2,StudentName=b;In DepartmentTable i have 2 Records thatis DepartmentID=1,DepartmentName=a; DepartmentID=2,DepartmentName=b;In StudentDetailsTable i Have one record i.e., StudentName=1,Department=1;and in My DataGrid i Connect StudentDetailsTable When the DataGrid Will Be Displayed it Displays as Follows i.e., StudentName=a,,Department=a;

i have 2 comboboxes(name,department) name Combobox Contains a Data From StudentNameTable its Display path=Name,Selected Value path=ID,and Department Combobox Contains Data From Department Table Display path=Name,Selected Value path=ID and these two combobox values are stored in Student Details Tables... in StudentDetails Table it Contains only StudentID,DepartmentId....

My Question Is When i Use Data Grid To Show the Student Details Table It Displays Only The Id,i Want To Disply The StudentName,and DepartmentName means How can I do This

推荐答案

<data.datagrid.columns>
<data:datagridtextcolumn binding="{Binding" path="StudentName}/" xmlns:data="#unknown">
<data:datagridtextcolumn binding="{Binding" path="Department}/">
</data:datagridtextcolumn></data:datagridtextcolumn></data.datagrid.columns>


if i Use Your Codeing Means The Whole Details of Names In StudentName,DepartmentName Will Be Displayed but My Question is Which One is Equal To StuentDetails Table That only Displayed in Gris View
For Ex..In StudentName Table i have 2 records That is StudentID=1,StudentName=a; StudentID=2,StudentName=b;
In DepartmentTable i have 2 Records thatis DepartmentID=1,DepartmentName=a; DepartmentID=2,DepartmentName=b;
In StudentDetailsTable i Have one record i.e., StudentName=1,Department=1;
and in My DataGrid i Connect StudentDetailsTable When the DataGrid Will Be Displayed it Displays as Follows i.e., StudentName=a,,Department=a;


这篇关于使用Silverlight如何根据ID在DataGrid中显示名称,部门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 09:17