We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SfDataGrid columns not resizing after visibility change from collapsed to visible

Hello,

We're having an issue with the SfDataGrid control when changing its visibility from Collapsed to Visible. I've attached a sample to see it in action with a basic dataGrid and custom templated columns.

Our dataGrid is using the ColumnSizer property set to Star and we know that if we're subscribed to the SizeChanged event and do dataGrid.View.Refresh() that it will work, but we're not interested in that solution because on our main application we have a bunch of controls and 3 dataGrids with information, imagine it like being a Dashboard, where if we do that, it'll start getting pretty slow to render when resizing the window.

Would like to know if this is a bug or is there another way to make the dataGrid resizable without using the Refresh when resizing the dataGrid?

Thank you and have a nice day,
Alexandru.

Attachment: DataGridVisibilityResizer_2e4823f2.rar

5 Replies

JG Jai Ganesh S Syncfusion Team March 28, 2017 02:07 PM UTC

Hi Alexandru, 
 
We cannot understand your requirement clearly but in title you have mentioned the columns are not resizing while changing the visibility from collapsed to visible. But you are not setting the AllowResizingColumns property as true in datagrid. Could you please set this property and try in your side? If this is not your requirement the please share the more information for the issue or if possible, please replicate the issue in your sample. This would be more helpful for us to proceed further. 
Regards, 
Jai Ganesh S 



AP Alexandru Pastor Opris March 28, 2017 03:59 PM UTC

Hello Jai Ganesh,

That's not what we're having issues with, the issue is the whole dataGrid is not resizing properly.

Let me give you more information and the steps to reproduce the problem on my sample, right now the issue is when the dataGrid starts with the property Visibility set to Collapsed and then we make it visible, when resizing the whole application from the edge of the application, the sizing is not working properly, it stays at the same width as originally when starting the application.

If we start the application at let's say 600px of width or anything which isn't fullscreen, the datagrid will stay always at that width, even when resizing the application, which shouldn't occur, as we're using the ColumnSizer property set to Star and not a specific width of 50, 60, etc. Also if we make the application smaller than the initial width, we'll see that the datagrid starts to show a horizontall scrollbar, as soon as we move that scrollbar, the dataGrid will execute the refresh of itself and display properly on the application.

Let me show you this with the following videos. On the first one we see that dataGrid is resizing correctly as it should, or atleast thats what we think (here we have the visibility set to Visible):



Here, on the second one, we have exactly the same dataGrid except that we've the visibility property set to Collapsed:



As you can see, it isn't resizing at all, only when I move the horizontal scrollbar, then it jumps at the current size of the window. Hope that this is enough information for the issue.

Thanks, and hace a nive day.
Alexandru.


JG Jai Ganesh S Syncfusion Team March 29, 2017 01:12 PM UTC

Hi Alexandru, 
 
We are able to reproduce the issue but this issue was already fixed in our current source and it will be available in our upcoming Volume 2 main release 2017. Could you please let us know whether you want a patch for this issue in your version? 
 
Regards, 
Jai Ganesh S 
 
 



AP Alexandru Pastor Opris March 29, 2017 02:09 PM UTC

Hello Jai Ganesh,

Yes, that would be great if we could get a patch for this issue.

Thanks, and have a nice day.
Alexandru.


JG Jai Ganesh S Syncfusion Team March 30, 2017 08:39 AM UTC

Hi Alexandru, 
A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates 
 
Regards, 
Jai Ganesh S 
 


Loader.
Live Chat Icon For mobile
Up arrow icon