DataGrid column weird behaviour - Collapsed not working

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
sd1388
Posts: 34
Joined: Mon Jan 30, 2017 9:51 am

DataGrid column weird behaviour - Collapsed not working

Postby sd1388 » Wed Aug 30, 2017 2:40 am

Hi Team,

I have to hide one column of Datagrid. it doesn't work on both simulator and browser. Please find below code snippet -
eg. - Here I have to hide "Id" so I applied collapsed but it doesn't work.

Code: Select all

<Grid Width="500" Height="300" VerticalAlignment="Top" HorizontalAlignment="Stretch">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="400"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="200"></RowDefinition>
        </Grid.RowDefinitions>
       
        <DataGrid x:Name="dgMain" Grid.Row="0" Grid.Column="0" Width="Auto" Height="Auto" AutoGenerateColumns="False" FontFamily="Arial" FontSize="11" >
            <DataGrid.Columns>
               <DataGridTemplateColumn  Header="Id" Visibility="Collapsed">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock x:Name="col1" Width="10" Text="{Binding Id}" HorizontalContentAlignment="Left"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="Name">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock x:Name="col2" Width="100" Text="{Binding Name}" HorizontalContentAlignment="Left"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn  Header="Email">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock x:Name="col3" Width="100" Text="{Binding Email}" HorizontalContentAlignment="Left"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn  Header="Address">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock x:Name="col4" Width="100" Text="{Binding Address}" HorizontalContentAlignment="Left"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
       
    </Grid>


Please suggest.

Thanks,
Swapnil

sd1388
Posts: 34
Joined: Mon Jan 30, 2017 9:51 am

Re: DataGrid column weird behaviour - Collapsed not working

Postby sd1388 » Thu Aug 31, 2017 6:40 am

Any update on this??

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: DataGrid column weird behaviour - Collapsed not working

Postby JS-Support @Userware » Fri Sep 01, 2017 9:49 am

Hi,

We have reproduced the issue and expect it to be fixed within 1 week.

Thank you.
Regards,
JS-Support

Nick
Posts: 84
Joined: Tue May 30, 2017 9:44 am
Contact:

Re: DataGrid column weird behaviour - Collapsed not working

Postby Nick » Tue Sep 05, 2017 1:09 am

I have this problem also, I resolve for the moment with set colum (Width = 0) in a function. When the issue is resolved change function code to Visibility ;)

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: DataGrid column weird behaviour - Collapsed not working

Postby JS-Support @Userware » Tue Sep 05, 2017 1:33 am

Hi,

The issue is supposed to have been fixed in Beta 11.17, which was released yesterday.

Please let me know if you still encounter the issue with this new version.

Thanks.
Regards,
JS-Support


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 4 guests

 

 

cron