How do you bind array to gridview? Will it works?

Answer Posted / uma

all the answers are correct, but its not write way to store
array to grid,if u insert data into grid view as the above
mension answers expect first one answer, the data will be
diaplayed in column wise, actually the data in grid view is
displayed in rowwise, so we convert array data into a
spesfic datasource like lists,generic list etc;


int32[] arr=new int32[10];
arr[1]=2;
arr[2]=3;

list<> lt=new list<arr>
lt.add(arr[1]);
lt.add(arr[2]);
GridView1.DataSource = lt;
GridView1.DataBind();

Is This Answer Correct ?    9 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is clickid?

553


What is ispostback property?

501


When Cookies are expired in ASP.NET?

571


Explain the difference between server control and html control.

474


What is the function of the ViewState property?

634






What is asp.net master page?

557


Which is better viewstate or session?

513


Give a few examples of page life cycle events.

670


How you will handle session when deploying application in more than a server?

587


Why is global asax is used for?

515


What is ipostback?

599


What is the asp.net control toolkit?

556


What is _viewstart?

501


Explain managed code an un-managed code.

592


Differentiate globalization and localization.

588