看到那行代码了,但是我还是不知道怎么在自己的程序中添加
这是前台代码:
<c1:C1DataGrid
RowHeight="18"
AutoGenerateColumns="True"
c1:C1NagScreen.Nag="True"
CanUserAddRows="False"
CanUserEditRows="False"
CanUserFreezeColumns="Left"
CanUserGroup="True"
CanUserRemoveRows="True"
ColumnHeaderHeight="18"
ItemsSource="{Binding Path=GridItemDetail, Mode=OneWay}"
Grid.Row="2"
HorizontalAlignment="Stretch"
MinColumnWidth="25"
Name="gridShow"
AutoGeneratingColumn="gridShow_AutoGeneratingColumn"
CreatingRow="gridShow_CreatingRow"
IsLoading="{Binding Path=GridIsLoading}"
SelectionMode="MultiRow"
ShowGroupingPanel="True"
VerticalAlignment="Top"
VerticalFreezingSeparatorWidth="2">
</c1:C1DataGrid>
这是后台xaml.cs代码
namespace LBS.SL.NewReport.View
{
public partial class NewTypeSppMoneyDay : UserControl
{
NewTypeSppMoneyVM VM
{
get { return DataContext as NewTypeSppMoneyVM; }
set { DataContext = value; }
}
public NewTypeSppMoneyDay()
{
InitializeComponent();
VM = new NewTypeSppMoneyVM(gridShow);
}
private void button1_Click(object sender, RoutedEventArgs e)
{
if (this.calendar1.Visibility == Visibility.Collapsed)
this.calendar1.Visibility = Visibility.Visible;
else
this.calendar1.Visibility = Visibility.Collapsed;
}
private void calendar1_DisplayModeChanged(object sender, RoutedEventArgs e)
{
if (this.calendar1 != null)
{
this.calendar1.DisplayMode = CalendarMode.Decade
;
this.calendar1.Visibility = Visibility.Collapsed;
}
}
void gridShow_AutoGeneratingColumn(object sender, C1.Silverlight.DataGrid.DataGridAutoGeneratingColumnEventArgs e)
{
try
{
LBS.SL.NewReport.ReportHelper.C1ControlHelper.ColInit_MoneySumYearRpt(e);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
void gridShow_CreatingRow(object sender, C1.Silverlight.DataGrid.DataGridCreatingRowEventArgs e)
{
try
{
if (e.Type == DataGridRowType.Group)
e.Row = new LBS.SL.NewReport.CustomRows.DataGridGroupWithSummaryRow();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
} |