Binding columns the grid

Nov 3, 2012 at 8:32 AM
Edited Nov 3, 2012 at 8:32 AM

Hi, 

This grid is really good and advanced.

I have a same query as one of the user has already mentioned in discussion "Binding Headers"...

I saw your code of binding,

you have used

<Controls:DataGrid.Columns>               

 <ExtendedColumn:ExtendedDataGridTextColumn Header="Game Name"
 AllowAutoFilter="False"  Binding="{Binding GameName}" />

</Controls:DataGrid.Columns>

 

This code is good when you have static number of columns.

But I have dynamic number of columns, so how should I bind those columns.

 

Thanks,

wpal

Coordinator
Nov 3, 2012 at 10:43 AM

Hi,

Issue is taken care in change set number 19550. Kindly take latest of the code.

Set AutoGeneratedColumns to true.

 

<ExtendedGridControl:ExtendedDataGrid x:Name="grid" GroupByControlVisibility="Collapsed" AutoGenerateColumns="True" ItemsSource="{Binding TestDataTable}">
            
</ExtendedGridControl:ExtendedDataGrid>

 

Regards,

bpoojary

 

Nov 5, 2012 at 8:22 AM

Hi,

It works now :-)

Thank you so much..

 

Regards,

wpal

Coordinator
Nov 5, 2012 at 4:16 PM
Edited Nov 5, 2012 at 4:20 PM

No problem


On Mon, Nov 5, 2012 at 2:52 PM, wpal25 <notifications@codeplex.com> wrote:

From: wpal25

Hi,

It works now :-)

Thank you so much..

 

Regards,

wpal

Read the full discussion online.

To add a post to this discussion, reply to this email (WPFExtendedDataGrid@discussions.codeplex.com)

To start a new discussion for this project, email WPFExtendedDataGrid@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Nov 7, 2012 at 9:35 AM
Edited Nov 7, 2012 at 9:37 AM

Hi,

While working on this gridview, i had a problem with refreshing the itemsource. 

It gives error because e.NewItems was a null value in this following function 

 void ColumnsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 

So i just add a code checking if e.NewItems is a null value before entering foreach loop in each NotifyCollectionChangedAction 

For example:

else if(e.Action==NotifyCollectionChangedAction.Remove)           
{               
if (e.NewItems != null)               
{                   
foreach (var column in e.NewItems)                 
{

}

This  if(e.NewItems != null)  solved my problem.

Please check it and make the required changes.

Regards,

wpal

Coordinator
Nov 8, 2012 at 5:40 PM

Hi,

 

I made these changes in change set number 19675.

 

Thanks,

bpoojary