Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

how to bind arraylist to gridview in

In previous articles we have seen how to Bind the data to grid view, Bind data to dropdownlist,Bind data to dropdownlist in gridview,Export gridview to PDF.Here i would like to explain how to bind Arraylist data to Grid view in the below i have used static array list for binding
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ArrayListToGridview.aspx.cs" Inherits="_ArrayListToGridview" %>

<html xmlns="" >
<head runat="server">
<title>Bind ArrayList to Gridview</title>
<form id="form1" runat="server">
<asp:GridView ID="GvBindArrayList" runat="server"
AutoGenerateColumns="False" >

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;
using System.Collections.Generic;
using System.Linq;

public partial class _ArrayListToGridview : System.Web.UI.Page
protected void Page_Load(Object Sender, EventArgs E)
if (!IsPostBack) {
ArrayList Booknames = new ArrayList();
Booknames.Add ("");
Booknames.Add ("");
Booknames.Add ("SharePoint");
Booknames.Add ("SqlServer");
Booknames.Add ("Jquery");
Booknames.Add ("Asp.netMVC");
GvBindArrayList.DataSource = Booknames;

This post first appeared on Aspdotnet-Sharepoint, please read the originial post: here

Share the post

how to bind arraylist to gridview in


Subscribe to Aspdotnet-sharepoint

Get updates delivered right to your inbox!

Thank you for your subscription