Silverlight Games
Forum    Resources    Communities    New Posts    Windows 7 tools    Members   

Action Games | Sports Games | Puzzles | Kids Menu | Showcase | Show All
Bookmark and Share

My Profile
Active Members
Today
    Last 7 Days more...




    Forums » Silverlight Discussion Forum » General Development »

    Adding datas in Grid dynamically


    Posted Date: 21 Jan 2010      Posted By:: Nila    Member Level: Bronze    Member Rank: 0     Points: 1   Responses: 1



    I want to add datas in grid dynamically and display it in the webpage while running by clicking a button , i need coding for that to add grid dynamically,how to add it in a project and how to retrieve the datas from the grid.




    Responses

    Author: Haribala     Member Level: Bronze      Member Rank: 408     Date: 20/Jun/2010   Rating: 2 out of 52 out of 5     Points: 4

    Hi,

    you can do simple way ,Just make a datatable and add column finally bind to grid.

    DataTable dt = (DataTable)Session["DATASESSION"];

    if ( dt == null ) {

    dt = new DataTable("Table");

    dt.Columns.Add("Col1");

    dt.Columns.Add("Col2");

    dt.Columns.Add("Col3");

    dt.Columns.Add("Col4");

    }
    dt.LoadDataRow(new object[]{inputcol1,inputcol2,.,.....});

    Session["DATASESSION"] = dt;

    Grid.DataSource = dt;

    Grid.DataBind();

    This is one way...

    if you want to clarificatoin about grid ,pls find the url here

    http://www.codeproject.com/KB/aspnet/dynamic_Columns_in_Grid.aspx

    http://www.dotnetschool.com/Resources/ASP.Net/Sample%20Codes/Gridview-Operation.aspx

    Thanks

    Haribala



    Post Reply

     This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.


    Next : Retrieve Data from arraylist
    Previous : Presentation
    Return to Discussion Forum
    Post New Message
    Category: General Development

    Related Messages





    About Us    Contact Us    Privacy Policy    Terms Of Use