Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I want to Show the Data from Database in aspx page
as
Name1,Class1,Address1,[delete][edit]
Name2,Class2,Address2,[delete][edit]

I am Using Gridview to show the data as i also Need delete and edit button.
For this I Concatenate "," with each database value and Hide the gridlines of Gridview
and then fetched the values Inside Gridview.
All is fine Still,
But I am facing Problem,Because the data are not of equal length .Due to which there are white spaces between data and also the Cell of gridview are expanding. Like below

Nameeeeee,Class1AAAAA,    Addres,[delete][edit]
   Name,    Class2A,Addressssssss,[delete][edit]

How can I remove the Whitespace between the cells of gridview .
Please assist. Or is there any other way to do this.
Posted

1 solution

try trimming the individual field values before concatenating them in sql, example:
SELECT RTRIM(LTRIM(fieldname)) FROM table1

However, I would suggest leaving them in their own columns in the gridview.
 
Share this answer
 
v3
Comments
Karwa_Vivek 12-Jun-14 7:24am    
Thanks for reply.
Found the Solution
I have Concatenated all the Values in a Single Field.
That Solved my Problem

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900