Hi,
I have a hierarchical set of datas like this :
public class RadiosGenre{ public List<Radio> Radios;} and I would like to put them in the xamDataGrid... and if possibe with "lazy loading"Is it possible and how ?
I have try with the following code but it do not work :
<igDP:XamDataGrid x:Name="xdgGenres"> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False" /> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="Title" Label="Title"/> <igDP:Field Name="Radios"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
Thanks a lot,
Also, is it possible to :
- Have only one header (and not a header for each level) ?- Have the last column to use the full width ... to force last column use the maximum of space ?
Thanks
VO01
Thanks,
Maybe it is possible to do this with code like this ?
private void AdjustLastColumnToFill(ListView lvw)
{
Int32 nWidth = lvw.ClientSize.Width; // Get width of client area.
// Loop through all columns except the last one.
for( Int32 i = 0; i < lvw.Columns.Count - 1; i++ )
// Subtract width of the column from the width
// of the client area.
nWidth -= lvw.Columns.Width;
// If the width goes below 1, then no need to keep going
// because the last column can't be sized to fit due to
// the widths of the columns before it.
if( nWidth < 1 )
break;
};
// If there is any width remaining, that will
// be the width of the last column.
if( nWidth > 0 )
lvw.Columns[lvw.Columns.Count - 1].Width = nWidth;
}
How do I control the columns display when displaying hierarchical data.
I have 2 tables
Table1 {'ParentID', 'Name', 'Type'} and Table2 { 'FKReferenceID', AccountName, AccountNumber}
while displaying in grid, I dont want to display ParentID in Table1 and 'FKReferenceID' in Table2.
can somebody help me, how to do this.
<igDP:XamDataGrid >
<igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False" /> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <!-- FieldLayout for Table 1 --> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="ParentID" Visibility="Collapsed"/> <igDP:Field Name="Name"/> <igDP:Field Name="Type"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout> <!-- FieldLayout for Table 2 --> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="FKReferenceID" Visibility="Collapsed"/> <igDP:Field Name="AccountName"/> <igDP:Field Name="AccountNumber"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts>
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="False" />
</igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts>
<!-- FieldLayout for Table 1 --> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="ParentID" Visibility="Collapsed"/> <igDP:Field Name="Name"/> <igDP:Field Name="Type"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout> <!-- FieldLayout for Table 2 --> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="FKReferenceID" Visibility="Collapsed"/> <igDP:Field Name="AccountName"/> <igDP:Field Name="AccountNumber"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout>
<!-- FieldLayout for Table 1 -->
<igDP:FieldLayout>
<igDP:FieldLayout.Fields> <igDP:Field Name="ParentID" Visibility="Collapsed"/> <igDP:Field Name="Name"/> <igDP:Field Name="Type"/> </igDP:FieldLayout.Fields>
<igDP:FieldLayout.Fields>
<igDP:Field Name="ParentID" Visibility="Collapsed"/> <igDP:Field Name="Name"/> <igDP:Field Name="Type"/>
<igDP:Field Name="ParentID" Visibility="Collapsed"/>
<igDP:Field Name="Name"/>
<igDP:Field Name="Type"/>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
<!-- FieldLayout for Table 2 -->
<igDP:FieldLayout.Fields> <igDP:Field Name="FKReferenceID" Visibility="Collapsed"/> <igDP:Field Name="AccountName"/> <igDP:Field Name="AccountNumber"/> </igDP:FieldLayout.Fields>
<igDP:Field Name="FKReferenceID" Visibility="Collapsed"/> <igDP:Field Name="AccountName"/> <igDP:Field Name="AccountNumber"/>
<igDP:Field Name="FKReferenceID" Visibility="Collapsed"/>
<igDP:Field Name="AccountName"/>
<igDP:Field Name="AccountNumber"/>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
Hello Prasanti,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I set the second FieldLayout’s Settings’ LabelLocation Property to Hidden. This way the child layout doesn’t have headers. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Thanks for taking the time to post your findings. Exactly what I was after and you saved me having to go through the steps, or similar, that you went through.
Cheers
Hello,
I would like to design XamDataGrid in the following way and not sure how can i achieve it. Can someone please help me.I am using MVVM pattern and using binding list to bind data
There will be three levels of drill down. For example Organization, Employee, Project.
Iniitally I want to show list of organizations which are edit only and we cannot add or delete organizations.
In second level, I would like to show list of employees where i can add/edit/delete employees. I this I need to show combo boxes as well.
In third level, I would like to show the project details they are working on. Here also I need to have Add/edit/delete the record option.
Currently I am achieving this using three grids. I would like to know whether we can merge these and show it in single Grid.
Follow this thread for the last question:
http://community.infragistics.com/forums/p/26803/98482.aspx#98482