Hello,
It is possible to use multiple cell renderer in the same column in SfDataGrid?
So when the cell value is not null -> I should use Textbox cell renderer with string value.
When the cell value is null -> I should use a Button cell and handle the click event.
After I click on button can I switch to Textbox cell from Button cell in realtime without refresh?
Thank you!
BR, SZL
Hi SZL,
Currently, we are analyzing your requirement for a “Multiple cell renderer based
on condition in SfDataGrid”. So, we need two more business days to validate this. We will
update you with further details on October 21, 2022.
We appreciate your patience until then.
Regards,
Vijayarasan S
Of course, thank you very much!
Hi SZL,
We deeply regret the delay and inconvenience caused.
We are still working on this. So, we need two more business days to validate this. We will update you with further details on October 27, 2022.
We appreciate your patience and understanding.
Regards,
Vijayarasan S
Of course, no problem. Thank you for help!
Hi SZL,
We deeply regret the delay and inconvenience caused.
We are still working on this. So, we need two more business days to validate this. We will update you with further details on October 31, 2022.
We appreciate your patience and understanding.
Regards,
Vijayarasan S
Your requirement to create multiple cells (ex: Button,
Textbox ) based on conditions in SfDataGrid can be achieved by creating a
custom column. Find the sample demo in the attachment.
UG Link: https://help.syncfusion.com/windowsforms/datagrid/columntypes#creating-new-column-and-renderer
KB Link: https://www.syncfusion.com/kb/11754/how-to-add-the-button-and-text-in-gridtextcolumn-in-winforms-datagrid-sfdatagrid
https://www.syncfusion.com/kb/11573/how-to-add-the-radiobutton-column-in-winforms-datagrid-sfdatagrid
If this post is helpful, please consider Accepting it as the solution so that
other members can locate it more quickly.
Hello,
Thank you very much for help and for the sample! Its very cool!
I have two little question about your solution:
I try set the cell value after button click with the following extended lines:
This works perfect, but I should update the above code without know the model type (OrderInfo).
I would like make a general solution where the model can be anything.
So my question is, how can I update the cell value after button click, without know the model type?
Can you confirm please, that your solution works well with advanced grid functions too? (for example Filtering, Grouping, Sorting etc. in all cases?)
Thank you very much!
Find the responses to your queries below.
Queries |
Responses |
|
This works perfect, but I should update the above code without know the model type (OrderInfo). I would like make a general solution where the model can be anything. So my question is, how can I update the cell value after button click, without know the model type? |
Your requirement to update the cell value after a button click, without knowing the model type in SfDataGrid can be achieved by using View.GetPropertyAccessProvider.GetValue method in SfDatGrid. Refer to the below code snippet,
|
|
Can you confirm please, that your solution works well with advanced grid functions too? (for example Filtering, Grouping, Sorting etc. in all cases?)
|
Yes. The custom column performs data operations (ex: Filtering, Grouping, Sorting) based on underlined data. |
Find the sample in the attachment.
Thank you very much, its works well!
Have a nice day!
We are glad that the reported issue was resolved on your side. Please let us know if you need any other details on this. As always, we will be happy to assist you.