Load 1 column in Gridview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sl1ver
    New Member
    • Mar 2009
    • 196

    Load 1 column in Gridview

    Hi
    im using xtragrid, i load all my colums from a datasource, but one column i created i want to load dynamically from a database.

    how will i load the column that has to use its own sql to retrieve the result based on parameters that i give it?
  • ssnaik84
    New Member
    • Aug 2009
    • 149

    #2
    I will try to understand your problem..
    1. you must be binding some datatable to your grid.
    2. before binding it, add a column to the datatable.
    3. loop through the data in your datatable and calculate value for your newly added column with your SQL. (you can write a method that will return value for the column using SQL)
    4. now, you will be having a datatable with existing data as well as your dynamic column data.
    so.. go ahead.. and bind the datatable to grid.

    Comment

    Working...