本文介绍了年假日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
如何将数据绑定到数据网格以在年假日历中检索输出...并提供示例项目
我的年假日历垂直显示月份,水平显示日期(1-31).就像我有一个网格
Hi All,
How to bind data to a datagrid for retrieving the output in a yearly leave calendar... and give sample projects
I have yearly leave calendar displaying months vertically and dates(1-31)horizontally. like i have a grid
<Grid x:Name="grdLeaveDetails"
ShowGridLines="false" Background="White"
Height="274" Width="482"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
.............................................
</Grid.ColumnDefinitions> .rows <Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>.
<Rectangle Grid.Row="1" Grid.ColumnSpan="32"
Fill="SkyBlue" RadiusX="1" RadiusY="1"
Height="0.5"
Margin="0,21,0,0"/>...................
<TextBlock Grid.Column="1" ><Run
Text="01"/></TextBlock>.... <TextBlock Grid.Column="31" ><Run
Text="31"/></TextBlock> ...<TextBlock
Grid.Column="0" Grid.Row="1" ><Run
Text="Jan"/></TextBlock> .... <TextBlock
Grid.Column="0" Grid.Row="12" ><Run
Text="Dec"/></TextBlock>
<data:DataGrid x:Name="grdLeaveCalender" Margin="-
29,0,0,8" Grid.RowSpan="13"
HorizontalAlignment="Left" Width="12" >
<data:DataGrid.Columns>
<data:DataGridTemplateColumn>
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Rectangle x:Name="rectrow"
Grid.Column="{Binding ddHolidayDate}
" Grid.Row="{Binding mmHolidayDate}"
Fill="Violet" ToolTipService.ToolTip="Holiday"/>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
</data:DataGrid.Columns>
</data:DataGrid>
</Grid>
无法将数据绑定到网格内的数据网格...对不起,我的详细代码和解释.
我从数据库获取请假日期,需要绑定数据并填充相应形成的矩形
谢谢
[从格式化的块中删除了非代码文本]
am unable bind the data to the datagrid inside a gird... sorry for my Long code and explanation.
I get the leave dates from the database and need to bind the data and fill the rectangles formed accordingly
Thanks
[Removed the non-code text from the formatted block]
推荐答案
这篇关于年假日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!