Do you mean you want to bind the grid to some datasource? If this is the case, then get the source of the data and bind to the grid. e.g. Say I have a datatable(dtBilling) as my datasource and my gridview name is dgBilling.
DataTable dtBilling = new DataTable();
dtBilling.Columns.Add("Product Name");
dtBilling.Columns.Add("Price");
dtBilling.Columns.Add("Unit Price");
dtBilling.Columns.Add("Total");
dtBilling.Rows.Add("Prod1", "100", "2.50", "250");
dtBilling.Rows.Add("Prod1", "200", "3.50", "3250");
dtBilling.Rows.Add("Prod1", "300", "4.50", "450");
dtBilling.Rows.Add("Prod1", "400", "5.50", "550");
if (dtBilling.Rows.Count > 0)
{
dgBilling.DataSource = dtBilling;
}
Hope this helps. But to be honest, the question does not seem to be very clear to me. Please let me know placidly, if you are looking a solution for this kind of problem or different! :)
Niladri Biswas