Click here to Skip to main content
15,903,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,,,

help me

how to reverse header column and data column in detailsview ??

thanks
Posted

Try adding dir="rtl" either to the GridView (if possible) or to a containing div. I can't try it out right now. If that is not what you wanted to do, please add some information.

---
Well if you can't get the direction inversion to work, you can define all your Columns as TemplateFields and implement the reverse direction yourself. The use of templatefields is described here[^]. You just add two
constructs per templatefield and you are done.
 
Share this answer
 
v2
Comments
shms_rony 10-Jun-11 17:06pm    
i do it but nothing reverse
<div dir="rtl"> <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px"> </div>
Morl99 10-Jun-11 17:10pm    
Please see my updated solution.
shms_rony 10-Jun-11 17:23pm    
i saw your upddated solution
i define my columns as TemplateFields but i can't implement the reverse direction in TemplateFields

your link not helpful
So what is your problem? Just do it like this in the template field:
<td><label text="HeaderText1" /></td>
<td><label text="<%=Eval("fieldname")%>" /></td>

That is what you mean by reverse direction right?
 
Share this answer
 
v4
Comments
shms_rony 10-Jun-11 18:54pm    
but i don't want to do it by converting to template field ..i convert direction of table to rtl but direction of columns of detailsview not reversed
what solution??

thanks
Morl99 10-Jun-11 19:36pm    
Why not convert it to a template field? It is a good solution. Maybe the direction thing does not work, it would be a hack anyways, and I feel this is not actually documented, so who knows when it will break. Visual studio helps you convert all your bound fields into templates fields. Do that and you win a lot of control. I end up having 80% template fields in my applications.

If you really want to do the direction thing, google for it, I am sure somebody out there figured it out, I have no expience with it.
According to this discussion in the forums on ASP.net[^] the dir="rtl" needs to be set in the table element.
 
Share this answer
 
Comments
Morl99 12-Jun-11 18:38pm    
Crazy ;) So the TS needs to wrap the GV into a table and set dir="rtl" in it...

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