Click here to Skip to main content
15,916,941 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to use RowDatabound in Mvc.In Asp.net we can use rowbound to provide the custom text to the data field in the grid view .Is there any way i cam do that in mvc?
example
0=a
1=b etc
Posted
Comments
Jameel VM 3-Sep-13 14:57pm    
why u are using gridview in mvc?
Member 9961335 3-Sep-13 15:04pm    
i am not i am actually asking a way to implement those the function of rowbound
Madhav Hatwalne 3-Sep-13 15:37pm    
that means you have to edit rows ?
Member 9961335 3-Sep-13 15:43pm    
no !leave_status value in my database are 0 1 2
but when i display it on table i want to show it as a b c instead of 0 1 2
Madhav Hatwalne 3-Sep-13 15:46pm    
How you are rendering your view ?

In MVC you have to use simple HTML tables or jQuery Data tables on click of edit link or image from a same row you can make it editable in a pop up or a separate view!
 
Share this answer
 
Comments
Member 9961335 3-Sep-13 15:43pm    
no !leave_status value in my database are 0 1 2
but when i display it on table i want to show it as a b c instead of 0 1 2
Madhav Hatwalne 3-Sep-13 15:46pm    
r u using Entity framework or not ?
If not then in your select statement use Case
Member 9961335 3-Sep-13 15:47pm    
i am using entityframework only
Kindly check this link I don't know linq to much but I think you want functionality like CASE statement in sql

How to Create T-SQL CASE Statements With LINQ To SQL[^]
 
Share this answer
 
Comments
Member 9961335 3-Sep-13 16:25pm    
Still searching !

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