Changing Card View Width Size

Hi Community, 

Is there a way to resize all the cards when converting GridDataBoundGrid(Classic) to cardview ? 
i have tried the code below but it doesn't work but for some reason card.Model.Rows.DefaultSize = 100 does work. Any help would be much appreciated !

GridCardView card = new GridCardView();
card.Model.Cols.DefaultSize = 100; 

Thanks in advance! 


1 Reply 1 reply marked as answer

BT Balamurugan Thirumalaikumar Syncfusion Team May 31, 2021 04:10 PM UTC

Hi Mohammad, 
 
Thank you for interesting in Syncfusion products. 
 
We have checked your query “Is there a way to resize all the cards when converting GridDataBoundGrid(Classic) to cardview ?” at our end. GridDataboundGrid supports the resizing by enabling the AllowResizing property. You can also use the QueryColWidth/QueryRowHeight events to change the size of the GridDataBoundGrid. You can refer the following code snippet for your reference. 
 
Code Snippet 
//Resizing cardview 
card.AllowResizing = true; 
 
//Event subscription 
card.Model.QueryColWidth += Model_QueryColWidth; 
card.Model.QueryRowHeight += Model_QueryRowHeight; 
 
//Event customization 
private void Model_QueryRowHeight(object sender, GridRowColSizeEventArgs e) 
{ 
    e.Size = 30; 
    e.Handled = true; 
} 
 
private void Model_QueryColWidth(object sender, GridRowColSizeEventArgs e) 
{ 
    e.Size = 100; 
    e.Handled = true; 
} 
 
 
We have attached the tested sample for your reference and you can download the same from the following location. 
 
Please let us know if you would require any other assistance. we will be happy to assist you. 
 
Balamurugan Thirumalaikumar  
  
 


Marked as answer
Loader.
Up arrow icon