Click here to Skip to main content
15,908,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I had GridView with three fields(columns).Now i need to add two columns to GridView at row[0].cells[4] and 5. can any one please help me.

Thanks in advance.
Posted
Updated 6-Dec-10 21:39pm
v2
Comments
Sandeep Mewara 7-Dec-10 1:45am    
Not clear.
tulasiram3975 7-Dec-10 2:05am    
i want to add unbound field to grid view at my specific position
TweakBird 7-Dec-10 3:39am    
Edited for readability & spelling.

Try this

DataControlField colIndex4 = new BoundField();<br />
        colIndex4.HeaderText = "Colunm 4";<br />
        grid.Columns.Add(colIndex4);<br />
<br />
        DataControlField colIndex5 = new CommandField();<br />
        colIndex5.HeaderText = "Colunm 5";<br />
        grid.Columns.Add(colIndex5);
 
Share this answer
 
how can bind the unbounded grid.<pre lang="c#"></pre>
 
Share this answer
 
Comments
tulasiram3975 9-Apr-12 6:07am    
Yes It is possible from code behind Better use bound field or template field in order to maintain columns order in our way....

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