Click here to Skip to main content
12,750,710 members (38,487 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET C#4.0 ASP.NET4
Hi,

I'm creating a grid view, the output I'm getting is like this:

<img src="http://i869.photobucket.com/albums/ab252/write2varun/gridview_zpsc34ad4d5.png" border="0" alt="grid view photo gridview_zpsc34ad4d5.png"/>


But I want the output as distinct GroupName and the Name should be separated by comma (,)
Eg:

<img src="http://i869.photobucket.com/albums/ab252/write2varun/gridview2_zps739c97d6.png" border="0" alt="grid 2 photo gridview2_zps739c97d6.png"/>

wanna wanna do it via. code side of the page

Thank You


p.s. i cannot change the query string
Posted 10-Sep-13 8:06am
Updated 10-Sep-13 8:46am
v4
Comments
Sergey Alexandrovich Kryukov 10-Sep-13 13:12pm
   
Looks pretty trivial. http://whathaveyoutried.com so far? what's the problem?
—SA
write2varun 10-Sep-13 13:18pm
   
I know what to do but I don't know how to do
Sergey Alexandrovich Kryukov 10-Sep-13 13:22pm
   
Do what? Generate HTML code with a table and cells in ASP.NET? Or get the data from database?
—SA
write2varun 10-Sep-13 13:24pm
   
i wanna get data from database into the gridview in that format
RyanDev 10-Sep-13 13:26pm
   
Where are you stuck?
write2varun 10-Sep-13 13:28pm
   
I don't know how to merge the value of rows and separate them with a comma
RyanDev 10-Sep-13 13:35pm
   
https://www.google.com/search?q=sql+concatenante+rows+into+column&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

You want to concatenate your rows into a column.
write2varun 10-Sep-13 13:39pm
   
yes, please let me try this
write2varun 10-Sep-13 13:41pm
   
Sorry I can't change anything in the query
RyanDev 10-Sep-13 13:52pm
   
In that case just loop through your records and process it however you need.
write2varun 10-Sep-13 13:57pm
   
okay, i will try it
Sergey Alexandrovich Kryukov 10-Sep-13 14:21pm
   
Then what prevents you from doing that? Do you have problems with ADO.NET? HTML? Writing HTML using ASP.NET? Understanding ASP.NET?
—SA
write2varun 11-Sep-13 0:56am
   
i will try to bind the rows using if and foreach

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170215.1 | Last Updated 10 Sep 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100