-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add the ability to specify a column width at the column level for the FluentDataGrid #1901
Comments
This would be possible, but would conflict with the existing We need to think about a solution that doesn't involve Breaking Change. |
I feel like you wouldn't want to mix/match specifying the width at the column level AND with the |
With the current rendering method (using the web components) we always need the GridTemplateColumn parameter. |
Sorry... I haven't been very clear in what I was thinking with regards to the design around this. I'm not suggesting that we remove the
Some pseudo code of the logic (I apologize for any incorrect syntax or spelling errors... just typing it out here): if(!string.IsNullOrWhitespace(grid.GridTemplateColumns) && grid.Columns.Any(x => !string.IsNullOrWhitespace(x.Width))
{
throw new Exception("You can only specify either the 'GridTemplateColumns' property on the grid, or the 'Width' property at the column level, not both.");
}
var gridTemplateColumnsToPassToWebComponent = grid.GridTemplateColumns;
if(string.IsNullOrWhitespace(gridTemplateColumnsToPassToComponent) && grid.Columns.Any(x => !string.IsNullOrWhitespace(x.Width))
{
gridTemplateColumnsToPassToWebComponent = string.Join(" ", grid.Columns.Select(x => x.Width ?? "auto"));
}
// Pass the `gridTemplateColumnsToPassToWebComponent` down to the web component
... Hopefully that makes sense. Doing it this way would not introduce a breaking change. Thoughts? |
Yep. That could be a solution |
🙋 Feature Request
It would be ideal to be able to specify the column width for a column at the column level instead of using the
GridTemplateColumns
property of the data grid. When building a dynamic grid that allows for adding/removing columns at runtime, and you have column widths specified using theGridTemplateColumns
property, you must also somehow dynamically update that property to correctly reflect which columns are going to be rendered. Otherwise, the rendering of the columns gets out of whack.🤔 Expected Behavior
Rendering of a data grid with dynamically added/removed columns should render correctly with column widths that are specified at design time.
😯 Current Behavior
If you add/remove columns from a data grid that has the
GridTemplateColumns
specified, you must also dynamically create that string value.💁 Possible Solution
Add a new property at the column level called
TemplateColumn
orWidth
that the grid would use to dynamically set theGridTemplateColumns
property.The text was updated successfully, but these errors were encountered: