3 Replies - 325 Views - Last Post: 01 May 2014 - 06:14 AM Rate Topic: -----

#1 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 433
  • View blog
  • Posts: 3,006
  • Joined: 12-January 10

add a column dynamically on button click

Posted 30 April 2014 - 10:43 AM

i am using c# asp.net'


 var db = Simple.Data.Database.OpenNamedConnection("sqlConn");
            DataTable dt = gridRatingEventHistory.DataSource as DataTable;
          

           
                string dateString = DateTime.Now.ToShortDateString();
                
                dt.Columns.Add(dateString);

                gridRatingEventHistory.Columns.Add(new GridBoundColumn
                {
                    UniqueName = dateString,
                    DataField = dateString,
                    HeaderText = string.Format("{0} ({1})", "New Event", "55")
                });



            gridRatingEventHistory.DataSource = dt;
            gridRatingEventHistory.Rebind();
            gridRatingEventHistory_CreatePonControls();



if you look at 1st image 1 you can see what it looks like -- when i hit the button i just want a blank column to show next to the last column however i get image 2 results how can i fix this

i am using telerik

Attached image(s)

  • Attached Image
  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: add a column dynamically on button click

#2 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3475
  • View blog
  • Posts: 10,721
  • Joined: 05-May 12

Re: add a column dynamically on button click

Posted 30 April 2014 - 07:41 PM

I'm not seeing GridBoundColumn in MSDN. Is that a custom grid column you wrote? Or is that the Telerik control you are using?
Was This Post Helpful? 0
  • +
  • -

#3 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 433
  • View blog
  • Posts: 3,006
  • Joined: 12-January 10

Re: add a column dynamically on button click

Posted 01 May 2014 - 03:59 AM

it's a telerik pos
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3475
  • View blog
  • Posts: 10,721
  • Joined: 05-May 12

Re: add a column dynamically on button click

Posted 01 May 2014 - 06:14 AM

You'll probably have more luck asking in the Telerik focused forums outside of DIC unless some are some Telerik users around here that can chime in.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1