Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HTML
country |   salary  |   name    |   adress  
------------------------------------------------
India   |   10000   |   ch1     |   something
japan   |   20000   |   ch2     |   nothing
india   |   25000   |   ch3     |   hjsdj
japan   |   30000   |   ch4     |   hjhjhj



i need to change my grid view column in left side

country | India
salary | 10000
name | ch1
adress |something

What I have tried:

i have no idea on this , plz guide me
Posted
Updated 24-Apr-16 23:03pm
Comments
Karthik_Mahalingam 25-Apr-16 4:32am    
you mean transpose?
Member 12119075 25-Apr-16 4:36am    
i mean the column should be arrange in left side .

issue: i will have grid view1 with button if user clicks that i need to proceed more details in grid view2. column should be in left hand side
Karthik_Mahalingam 25-Apr-16 4:46am    
so in the second grid view you have to display the selected row in your mentioned style ??
ShadowsrayChamhell 25-Apr-16 4:41am    
Do you mean the Column header or the contents of columns are to be aligned on the left?
Member 12119075 25-Apr-16 4:48am    
content of columns to aligned to left

Try to use ListView instead of GridView.
Here is some code.
ASP.NET
<HeaderTemplate>
            <table>
        </HeaderTemplate>
        <itemtemplate>

                <tr>
                    <td>
                        <asp:label id="Label1" runat="server" text="<%# Eval("col1") %>" xmlns:asp="#unknown"></asp:label>
                    </td>
                    <td>
                        <asp:label id="Label2" runat="server" text="<%# Eval("col2")%>" xmlns:asp="#unknown"></asp:label>
                    </td>
                </tr>
                <tr>
                    <td colspan="10">
                        <asp:label id="Label3" runat="server" text="<%# Eval("Text") %>" xmlns:asp="#unknown"></asp:label>
                    </td>
                </tr>

        </itemtemplate>
        <edititemtemplate>

                <tr>
                    <td>
                        <asp:label id="Label1" runat="server" text="<%# Eval("col1") %>" xmlns:asp="#unknown"></asp:label>
                    </td>
                    <td>
                        <asp:label id="Label2" runat="server" text="<%# Eval("col2") %>" xmlns:asp="#unknown"></asp:label>
                    </td>
                </tr>
                <tr>
                    <td colspan="10">
                        <asp:textbox id="TextBox1" runat="server" text="<%# Bind("Text") %>" xmlns:asp="#unknown"></asp:textbox>
                    </td>
                </tr> 
        </edititemtemplate>
        <footertemplate>
            </footertemplate></table>
 
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