Skip to content
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

Change grid editor dynamically & how to apply custom formatter #73

Open
awisey opened this issue Oct 23, 2015 · 2 comments
Open

Change grid editor dynamically & how to apply custom formatter #73

awisey opened this issue Oct 23, 2015 · 2 comments
Labels

Comments

@awisey
Copy link

awisey commented Oct 23, 2015

Hi Scott,

I have a couple of things i cant seem to figure out?

  1. Do you have any sample code on how to change a column on a row from read only to editable? For example if one column is a checkbox and the others initially are read only then when the checkbox in checked to be able which of the readonly become editable? I see the how to define columns in the view but cant figure out to make it dynamic.

  2. I see you have a formatter option on the xrmcloumn types. How do you apply a custom formatter to a column?

Kinds regards
Andrew

@scottdurow
Copy link
Owner

1: You need to add some pre-edit logic to check if the field is editable or not. This is done using the OnBeforeEditCell event. For an example see -

sessionsGrid.OnBeforeEditCell.Subscribe(delegate(EventData e, object args)

I would call a function such as CanEdit on the ViewModel from this event.

2: For an example of a custom column formatter see the MultiEntitySearch sample card column formatter -

cardColumn[0].Formatter = RenderCardColumnCell;

Hope this helps!

@scottdurow
Copy link
Owner

Hi Andrew -how did you get on with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants