Array, dataset use for datagrid

Results 1 to 2 of 2

Thread: Array, dataset use for datagrid

  1. #1
    Join Date
    Dec 1969

    Default Array, dataset use for datagrid

    I have a datagrid that returns numbers in a column. I need to do mathmatical problem on each of those numbers, then return the new value to a new datagrid.. how would I do this? Could I create an array with the answers I got, somehow set those = to a new dataset and then use that dataset dynamically to populate a datagrid?? I got the answers using a FOR NEXT loop and it worked just fine. Just don't know what to do next.

  2. #2
    Join Date
    Dec 1969

    Default RE: Array, dataset use for datagrid

    If all of your answers are already in an ArrayList, you can set that arraylist as the datasource of the datagrid:<BR><BR>dg.DataSource = CalculatedValuesArrayList;<BR>dg.DataBind();<BR><B R>Since ArrayList implements IEnumerable, you can bind it to any "repeater"-like web control.<BR><BR>If you want more information in the grid than just the calculated numbers you could loop through the arraylist and create a new DataTable object, adding more columns (i.e. Description??). Then bind the Table.DefaultView object to the datagrid.<BR><BR>There are some other simple ways to do this, too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts