Dynamically Set Header Text

3 posts, 0 answers
  1. bill
    bill avatar
    31 posts
    Member since:
    Sep 2007

    Posted 29 Jun 2010 Link to this post



    what is the proper way to dynamically set the headetext field? i tried these

     

     

     

    <Columns> <telerik:GridBoundColumn DataField="Question" HeaderText='<%#Eval("SubjectArea") %>' SortExpression="Question" UniqueName="ContactName">   
     </telerik:GridBoundColumn>   
     </Columns> 
     
    <Columns>   
    <telerik:GridBoundColumn DataField="Question" HeaderText='<%#Bind("SubjectArea") %>' SortExpression="Question" 
     
    UniqueName="ContactName">   
     </telerik:GridBoundColumn> </Columns>   
     
     

     

     

     

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 30 Jun 2010 Link to this post

     Hello Bill,

    A better option for changing the HeaderText of GridBoundColumn is by using code behind rather than from mark-up.

    C#: 
      
     protected void RadGrid1_PreRender(object sender, EventArgs e) 
        { 
            RadGrid1.MasterTableView.GetColumn("CheckInTime").HeaderText = "Check Out"
            RadGrid1.MasterTableView.Rebind(); 
        } 


    Hope this information helps you.
    Princy.
  3. somsak
    somsak avatar
    2 posts
    Member since:
    Dec 2014

    Posted 29 Jun 2017 in reply to bill Link to this post

    ujj
Back to Top