Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
200
Embedded Checkbox disappears after printing in XamDataGird
posted

XamDataGrid in my application contains embedded Images, Checkboxes. After Printing the images disappears. If the XamDataGrid is scrolled to the bottom & restored to the origianl position, then the images & checkboxes re-appears. Also, if another tab is selected and switched back to the previous tab, then the images & checkboxes are restored.

Printing:

  Report reportObj = new Report();
           
            EmbeddedVisualReportSection section = new EmbeddedVisualReportSection((Visual)xamDataGridEditor);

            reportObj.Sections.Add(section);

            reportObj.Print();

Populating XamDataGrid:

 public void PopulateXamDataGrid()
        {
            DataSet ds = new DataSet();
            DataTable dt = GetDataSource();
            xamDataGrid.DataSource = ds.Tables[0].DefaultView;
        }

private DataTable GetDataSource()
        {
            DataTable dt = new DataTable("Test");
            dt.Columns.Add("S.No.", typeof(int));
            dt.Columns.Add("A", typeof(CheckBox));
            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("Employee Code", typeof(string));
            for (int i = 0; i < 1000; i++)
            {
                DataRow dr = dt.NewRow();
                dr["S.No."] = i;
                CheckBox cbx = new CheckBox();
                dr["A"] = cbx;
                dr["Name"] = "Test " + i + " Name";
                dr["Employee Code"] = "Code 2011" + i;
                dt.Rows.Add(dr);
            }
            return dt;

        }