adding fields in gridview

Posted by Klbaiju under ASP.NET on 2/5/2010 | Views : 1236 | Status : [Member] | Replies : 4
Hi,

i want to add 2 fields
fname and lname.i want to add this fields in a gridview how it is possible.


Regards
K L BAIJU




Responses

Posted by: Raja on: 2/5/2010 [Member] Starter

Up
0
Down
There are many ways to do that

You can use BoundField or TemplateField etc.

For example to user fName use following under <Columns> </Columns>
 <asp:BoundField DataField="fName" HeaderText="First Name" />


I would suggest to read the first code snippet of this article carefully and you would understand. http://www.dotnetfunda.com/articles/article29.aspx .

Thanks


Regards,
Raja, USA

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 2/5/2010 [Member] Bronze

Up
0
Down
hiiiiii ref this link


http://www.codeproject.com/KB/aspnet/How_to_create_custom_boun.aspx

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bubbly on: 2/5/2010 [Member] Bronze

Up
0
Down
Hello,

Check this link

http://www.codeproject.com/KB/webforms/addupdate.aspx

++
Thanks & Regards,
Deepika

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajaydabhade on: 3/10/2010 [Member] Starter

Up
0
Down
One of the simple way is,

<asp:gridview ID="Gridview1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField HeaderText="First Name" DataField="fname"/>
<asp:BoundField HeaderText="First Name" DataField="lname"/>
</Columns>
</asp:gridview>




AJAY DABHADE
(MCPD, MCTS)
"Plan your work, work on your plan and your plan will work."

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response