Click here to Skip to main content
15,886,755 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in my project i have a 2d array

Dim arrValues(1 To 12, 1 To 3)

where column1 is for storing month name e.g jan, feb ,... dec

column2 is for amountcharged (number)

column3 is for amountreceived (number)

now i want to copy this data into data grid.
can u manage to give me exact code how to do it?
thnks.
Posted
Updated 7-Jul-11 6:34am
v3

Hi

I am not sure if this is what you require.
You can save your array details and source your datagrid to the array.
You can modify presentation of columns according to your requirement in Datagrid using DataBind feature.

Please let me know if you need in more detail;
 
Share this answer
 
Yes i require binding of array to data grid but i dont know how to do it. m not getting code to do this.
 
Share this answer
 
you can just populate your array/datalist named array1.

considering your grid view id as gridID1, PFB code for this:
To make sure you are not populating an empty array,
C#
if(array1.Count > 0)
{
    gridID1.DataSource = array1;
    gridID1.DataBind();
}

This is in C#, I am not sure of VB syntax, but it shd not be very difficult.
 
Share this answer
 
v2

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