iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Is there a way to specifiy that a certain column cannot be moved or deleted? I have a column of type Template, which is a checkbox, that should not be able to be removed from the column list but all of the rest of the columns can be removed and rearranged. I don't see a property on the column itself that would prevent it from being moved or rearranged. Is there something like that?
Thanks,
Brad
Hello Brad,
Defaultly, our WebGrid could not move or do select/unselect Column if AllowColumnMoving or AllowColumnSelect is set into false. So, please ensure those properties are not set true.However, all the columns/structured that has been loaded (via design or code), can still add a new column or remove a column in the structure and this is as designed. Please let me know more details about why do you need in your scenario such as how do you removed a column list or something.
Regards,Handy
Handy,
My situation is that I want to allow the user to rearrange and move all columns BUT one. So I want "AllowColumnMoving" and "AllowColumnSelect" to be true for all columns except that column. So my question is whether or not I can apply "AllowColumnMoving" to some columns but not others. Is there a way to specify that a particular column cannot be moved or removed?
Hi Brad,
Sure, you can validate at OnColumnMove clientside event.Here is the sample of my snippet codes.
function WebGrid1_OnColumnMove(controlId, tblName, sourceIndex, targetIndex, sourceColumn, targetColumn) { var WebGrid1 = ISGetObject(controlId); if (sourceColumn.Name == "checkbox1" || targetColumn.Name == "checkbox1") { return false; } return true; }
If the current column is also in ColumnContextMenu, you can validate at OnColumnContextMenu client side event. (this feature only available in WebGrid 7)Here is the sample of my snippet codes.
function WebGrid1_OnColumnContextMenu(controlId, col, menu, isGroup, location) { var WebGrid1 = ISGetObject(controlId); var mnuSelect = menu.Items.GetNamedItem("mnuSelectColumns"); mnuSelect.Items.GetNamedItem("mnuCol_checkbox1").Disable(); return true; }
Hope this helps.
Thanks Handy. That is helpful.
Glad to hear that It can help you.
I was able to successfully implement your suggestion for the column move but I still am not sure how to prevent removal via the context menu.
You wrote that "If the current column is in "ColumnContextMenu...," but I'm not sure what that means. What is "ColumnContextMenu."
Also, what is the "NamedItem" that I should be searching for in instead of "mnuCol_checkbox1." I changed this to the name of the column in question but I got a javascript error.
Please try to right clcik on Header column. It will show you context menu. If AllowSelectColumns is set true, you can select/unselect WebGrid column dynimacally. At my sample code, my column name is "checkbox1". In order to disable the click on ContextMenu, I will need to get the object. In context menu, the name is starting from "mnuCol_(name of your column)".
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname