Click here to Skip to main content
15,887,854 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
i bind a gridview and one of the column show the data this form "aaa#;7" i want show just "aaa", how can i remove "#;7" from the end of data in gridview column when it bindings.

Thnaks
Posted
Comments
Krunal Rohit 22-Feb-14 23:55pm    
ASP .NET ?
-KR

if "how can i remove "#;7" from the end of data" is your question

use the following code
string s= dt.rows[0]["MyField"].ToString().Replace("#;7","");
 
Share this answer
 
process grid for that particular column & replace its string value using row data bound event.

C#
string requiredStr = inputStr.Substring(0,inputStr.IndexOf('#'));
 
Share this answer
 

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