DataRow dr = this.DataGrid.Items[this.DataGrid.SelectedIndex];

解决方案 »

  1.   

    2、
    当然可以啊,这是push模式...see:
    http://www.microsoft.com/china/community/Column/26.mspx
      

  2.   

    DataRowView sDataRowView = (DataRowView)dataGridMain.BindingContext[dataGridMain.DataSource].Current;这样不管datagrid是否是排序过乐,都可以得到对应的datatable的值
      

  3.   

    to  dattotzy(酋长)
    我这里怎么没有Items属性,我查帮助查到了此属性,但编辑器里面点不出来???
    还有,SelectedIndex也没有??????
    我是winfrom的程序.
      

  4.   

    SelectedIndex也没有??????CurrentIndex
      

  5.   

    DataSet dsReport =new dataSet();
    ....
    CrystalDecisions.CrystalReports.Engine.ReportDocument doc=new CrystalDecisions.CrystalReports.Engine.ReportDocument();
    doc.Load(sReportPath+sReportname);
    if(dsReport != null)doc.SetDataSource(dsReport.Tables[0]);
    ...
    doc.SetParameterValue(...)
    ...
    this.crystalReportViewer1.ReportSource=doc;
    ...
    this.crystalReportViewer1.RefreshReport();
    ...
    this.crystalReportViewer1.PrintReport();
    ...
    this.Close();
      

  6.   

    1、DataRow theRow= this.DataGrid.Rows[this.DataGrid.SelectedIndex];
    2、能用自己的DataSet
    CrystalReport1.SetDatasource(DataSet);
    crystalReportViewer1.ReportSource=CrystalReport1;