Hello,
Filtered datagridview data print with print document. sql Data table with c#
dear sir,
it is not working.
Should I use a models for that?
So how do I connect a data grid to a models?
could you please to help me..
i used below codes..(with out models)
*).DataTable dtdata = new DataTable();
*).adapter = new SqlDataAdapter("SELECT * FROM dbo.data", connection);
adapter.Fill(dtdata);
*).(dataGridView1.DataSource as DataTable).DefaultView.RowFilter = string.Format("txt1 like '%" + txt1.Text + "%'");
*).e.Graphics.DrawString(datafind[i].Txt.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(150, 200));
What I have tried:
e.Graphics.DrawString(datafind[i].Txt.ToString(), new Font("Arial", 12, FontStyle.Regular), Brushes.Black, new Point(150, 200));