About 79,600 results
Open links in new tab
  1. How can I set the width of a DataGridColumn to fit contents …

    I have a WPF DataGrid that contains some data. I would like to set the width of the columns such that the content fits in and never gets cropped (instead, a horizontal scroll bar should become …

  2. Change DataGrid cell colour based on values - Stack Overflow

    Apr 5, 2011 · 177 If you try to set the DataGrid.CellStyle the DataContext will be the row, so if you want to change the colour based on one cell it might be easiest to do so in specific columns, …

  3. How can I set the color of a selected row in DataGrid

    In my case, the reason was that I also had a CellStyle in my datagrid, and the CellStyle overrode the RowStyle I was setting. Interestingly so, because the CellStyle wasn't even setting the …

  4. c# - WPF DataGrid cell value changed event - Stack Overflow

    Dec 23, 2015 · WPF DataGrid cell value changed event Asked 9 years, 11 months ago Modified 6 years, 2 months ago Viewed 66k times

  5. How to center the content of cells in a data grid? - Stack Overflow

    This is rather an old post, but if someone still needs this and finds that the borders/separations of cells are gone when using the approved answer, it's because they are using a Grid instead of …

  6. Binding Visibility for DataGridColumn in WPF - Stack Overflow

    First of all, DataGridTextColumn (or any other supported dataGrid column) does not lie in the Visual tree of the DataGrid. Hence, by default it doesn't inherit the DataContext of the …

  7. DataGrid in .NET MAUI - Stack Overflow

    Nov 24, 2022 · The DataGrid control hasn't been available or approachable in .NET MAUI. However, you can follow up this feature request: [Enhancement] DataGrid Control on Github.

  8. c# - Datagrid binding in WPF - Stack Overflow

    The DataGrid is derived from ItemsControl, which relies on its ItemsSource property to define the collection it binds its rows to. Hence, if list isn't a property of an object bound to your control's …

  9. Get selected row item in DataGrid WPF - Stack Overflow

    Oct 12, 2010 · I have a DataGrid, bound to Database table, I need to get the content of selected row in DataGrid, for example, I want to show in MessageBox content of selected row. Example …

  10. winforms - Good DataGridView tutorial - Stack Overflow

    Aug 9, 2013 · I'm writing a windows C# application which I wish to use data grid views, but unable to find a good tutorial on to take complete control of the datagrid eg: add columns, add data etc.