Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,

I am newbie in WPF. Currently i am creating DataGrid in WPF.

XAML CODE :
<DataGrid x:Name="DGMDStatus" AutoGenerateColumns="False" Height="440" HorizontalAlignment="Left" Margin="22,80,0,0" VerticalAlignment="Top" Width="800" BorderBrush="#FF000C21" BorderThickness="0.5" AlternatingRowremoved="#fff" HorizontalScrollBarVisibility="Hidden" CanUserAddRows="False" IsReadOnly="True">
	<DataGrid.Columns>
		<DataGridTextColumn Header="Status Id"  Width="200" Binding="{Binding StatusId}"/>
		<DataGridTextColumn Header="Status" Width="300" Binding="{Binding Status}"/>                       
	</DataGrid.Columns>
</DataGrid>


CODE BEHIND :
DGMDStatus.ItemsSource = dbcon.sp_StatusMaster_SelectAll().ToList();


So how can i check “Status” is null or not during databinding in code behind.
Please help me... Thanks.

Posted
Comments
[no name] 10-Aug-14 6:47am    
Why not just not query null values from your database?

1 solution

You can use a value-converter, for that purpose.

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900