Adding new rows via Datatable for RadGrid (Help with Check Boxes)

4 posts, 0 answers
  1. TIM
    TIM avatar
    17 posts
    Member since:
    Oct 2011

    Posted 24 Oct 2011 Link to this post

    Hey guys, having some issues, been racking my brain...

    I am trying to provide list results in a radgrid.

    my code so far is:

    dt.Columns.Add("chk")
    dt.Columns.Add("Profile Image")
    dt.Columns.Add("Name")
    dt.Columns.Add("Info1")
    dt.Columns.Add("Info2")
    dt.Columns.Add("Score")
    dt.Columns.Add("Actions")
     
     
     
    dt.Rows.Add(CheckBox, Image, "#Name#", "#Info#", "#Info2#", "#Score#", "##Actions##")
     
    RadGrid1.DataSource = dt
    RadGrid1.Rebind()

    I am having issues setting checkbox, and image. I assume if I can get an example of 1, I can figure out the other.

    I was also going to be adding buttons into the 'Actions' column as well.


    Thanks in advance!
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Oct 2011 Link to this post

    Hello Tim,

    I tried the same scenario and it worked as expected. Here is the sample code.

    C#:
    dt.Columns.Add("chk");
    . . . .
    dt.Columns.Add(myDataColumn);
    DataRow row=dt.NewRow();
    dt.Rows.Add(dt.Rows.Add(row);
    RadGrid1.DataSource = dt;
    RadGrid1.DataBind();

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. TIM
    TIM avatar
    17 posts
    Member since:
    Oct 2011

    Posted 25 Oct 2011 Link to this post

    In your code, that added a check box column?
  5. Jonathan
    Jonathan avatar
    5 posts
    Member since:
    Sep 2016

    Posted 21 Oct in reply to Shinu Link to this post

    I'd like to add a DT to a radgrid which is already filled by SQL statement. Is there a way to append new rows from a NEW DataTable to an existing radGrid?
Back to Top