Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > GridView > How to edit custom footer

Answered How to edit custom footer

Feed from this thread
  • Kristjan Einarsson avatar

    Posted on Feb 7, 2012 (permalink)

    Hi, I'm not sure if I am on track here, I hope there is an easier solution to this.
    But I am trying to create an grid with footer witch has three editable rows (see attachment). My code is the following ->

    private GridViewDataColumn bindColumn(string bindText, string headerAndTag, string cellText1, string cellText2, string cellText3)
            {
                GridViewFooterCell cell = new GridViewFooterCell();
                StackPanel sp = new StackPanel();
                TextBox cell1 = new TextBox() { Text = cellText1 };
                TextBox cell2 = new TextBox() { Text = cellText2 };
                TextBox cell3 = new TextBox() { Text = cellText3 };
     
                sp.Children.Add(cell1);
                sp.Children.Add(cell2);
                sp.Children.Add(cell3);
     
                GridViewDataColumn col  = new GridViewDataColumn();
                col.HeaderTextAlignment = TextAlignment.Right;
                col.DataFormatString    = "{0:N0}";
                col.TextAlignment       = TextAlignment.Right;
                col.Header              = headerAndTag;
                col.Tag                 = headerAndTag;
                col.DataMemberBinding   = new Binding(bindText) { Mode = BindingMode.TwoWay };
     
                col.Footer = sp;
                return col;
            }

    My question is: Is there a better way to achieve this ? Should I perhaps use other things than TextBox ?
    Can someone give me some tips.

    Thank you.
    Kristján
    Attached files

    Reply

  • Answer Vlad Vlad admin's avatar

    Posted on Feb 7, 2012 (permalink)

    Hello,

     Indeed adding desired UI elements using column Footer property is the right way. You should not need however creation/adding GridViewFooterCell.

    Regards,
    Vlad
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > GridView > How to edit custom footer
Related resources for "How to edit custom footer"

WPF Grid Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]