Hi Ali,
Greetings from Syncfusion support.
Query:
“I want to hide and show sfgrid
column when batch edit”
We would like to inform you that,
we have inbuilt Visible property to hide particular column in the DataGrid. We
suggest you to hide the particular column dynamically while performing CRUD
operations in the Grid. We have attached documentation link for your reference.
Reference: https://blazor.syncfusion.com/documentation/datagrid/columns#visibility
https://blazor.syncfusion.com/documentation/datagrid/editing#event-trace-while-editing
If you’ve any further queries, please don’t hesitate to get back to us.
Regards,
Sarvesh
actualy when i am batch updating i want to show different column dynamicaly and when batch edit complete after succcess i want to show old column so how i can achieve please need a demo
Hi Ali,
We checked your query, we would like to inform you that you
can retrieve the original and edited values by using the OnCellSave event in
the grid. We suggest referring to the below documentation for more information.
Documentation : https://blazor.syncfusion.com/documentation/datagrid/events#oncellsave
If it doesn’t meet your requirement then kindly
share the below details to validate further at our end.
Regards,
Naveen Palanivel
its all about hide and show columns in batch edit mode sfgrid
e.g:
Name | Phone | Address
John | 032323 | XYZ
when i double click on row i want to show following columns
Name | Phone | Country | State | City
input |
input |
input | input | input
another example check in attachment
please also check this thread i created in details
https://www.syncfusion.com/forums/182132/hide-show-colunm-in-batch-mode
Attachment: Attachment_235076f5.zip
Hi Ali,
We checked your query and we
suspect that if the value is edit, you want to show the hidden column and then
hide it once the change is saved. Based on that we prepared the simple sample,
attached in this ticket . Please refer the attached sample and code snippet for
more reference.
<GridColumn Field=@nameof(Order.OrderDate) HeaderText="Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Center" Width="130"></GridColumn> <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Center" Width="120"></GridColumn> </GridColumns> <GridEvents TValue="Order" CellSaved="CellSavedHandler" OnCellEdit="CellEdit"></GridEvents> </SfGrid>
@code { private SfGrid<Order> DefaultGrid;
public void Hide() { // Hide columns by its header text this.DefaultGrid.HideColumns(ColumnItems); }
public void CellSavedHandler(CellSaveArgs<Order> args) { DefaultGrid.EndEditAsync(); Hide(); } |
Please let us know if you have any concerns.
Regards,
Naveen Palanivel