Please help me how to do this - Urgent

  • Thread starter Thread starter settyv
  • Start date Start date
S

settyv

Hi,

I need to merge some of the rows in the datagrid in asp.net 1.1 with
comma separator.For example i have column name Filed_by which list the
customer's full name.Now i need to merge all the customer name cells
into single cell seperated by comma. Please let me know how can i do
that.Also if you have some example that would be great.


Thanks,
Vishnu
 
Assuming you cant merge your values in SQL, you can probably iterate the
dataset / datatable in a loop, pick out the values and glue them together or
you could probably just use a templatecolumn and merge the columns that way

As an iteration example this might get you started:

ArrayList s = new ArrayList();
foreach (DataRow myDataRow in myDataSet.Tables["Customers"].Rows)
{
s.Add(myDataRow["filed_by"].ToString() +
myDataRow["full_name"].ToString());

}


Then bind that to your datagrid as shown here

http://www.johntimney.com/blog/default.aspx#ad32c3fbf-db15-4fa0-8ae3-95c3f29a8a8a

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
 
Back
Top