0

Using a DataGrid from WPFToolkit, I bind it to a datatable. On certain scenario I want to add a row which only contains a single button horizontally centered. The columns I defined In the DataGrid are two textcolumns and one columntemplate. Is this possible?

patlimosnero
  • 963
  • 4
  • 13
  • 22
  • You want to add only one row with the button, and that row would not be binded to another in the datatable? In that case go with Davide's answer. – Natxo Sep 09 '11 at 07:58

1 Answers1

2

Grids are designed to work like tables or nets with cols and rows mostly uniform. if you need a button only at the bottom i would try to customize grid footer more than a gridrow. you could probably do everything with some templates and bit of custom code but i would really go for the footer :-)

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • I tried the footer but it seems that the footer is not included as scrollable item. THe vertical scroll bar was for the items in the datagrid only. What I want is a to add a last row in the datagrid which contain a button. Is this possible? – patlimosnero Sep 09 '11 at 10:14
  • what do you have to do with that button? I think is ok that you always see the button in the footer with no scrolling. – Davide Piras Sep 09 '11 at 10:21
  • actually i really want to have the button always seen in the bottom..but our client wanted it to be included in the scrollable items (have it included in the last row of the datagrid). I was thinking to restructure my implementation and use other controls, maybe list view with grid control inside and have a scrollview but my time is really limited and so im pushing to stick with my current implementation. – patlimosnero Sep 09 '11 at 11:17
  • http://www.wpftutorial.net/DataGrid.html according to this site. DataGrid has a property RowsDetailsTemplate like this . I was wondering why this property is not present in WPFToolkit DataGrid or maybe i just miss something. – patlimosnero Sep 09 '11 at 11:20
  • you would need a ColSpan in the grid row for that and inside the single cell with colspan == all column count, you would put your control (button). check this out for examples: http://stackoverflow.com/questions/5679081/looking-for-explanation-for-wpf-grid-columnspan-behavior – Davide Piras Sep 09 '11 at 11:21
  • ill check on this one.thanks! ill get back to you after. wish me luck! :D – patlimosnero Sep 09 '11 at 11:22