﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Column removal on some columns but not others</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Column-removal-on-some-columns-but-not-others/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Column removal on some columns but not others</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Column-removal-on-some-columns-but-not-others/</link><pubDate>Mon, 26 Apr 2010 15:34:06 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hi Brad,&lt;/p&gt;&lt;p&gt;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. &lt;br /&gt;At my sample code, my column name is "checkbox1". In order to disable the click on ContextMenu, &lt;br /&gt;I will need to get the object. In context menu, the name is starting from "mnuCol_(name of your column)". &lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Column removal on some columns but not others</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Column-removal-on-some-columns-but-not-others/</link><pubDate>Mon, 26 Apr 2010 15:16:52 GMT</pubDate><dc:creator>bloveall</dc:creator><description>&lt;p&gt;Handy,&lt;/p&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;p&gt;You wrote that "If the current column is in "ColumnContextMenu...," but I'm not sure what that means. What is "ColumnContextMenu."&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Brad&lt;/p&gt;</description></item><item><title>Column removal on some columns but not others</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Column-removal-on-some-columns-but-not-others/</link><pubDate>Fri, 23 Apr 2010 17:07:42 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Glad to hear that It can help you.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Column removal on some columns but not others</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Column-removal-on-some-columns-but-not-others/</link><pubDate>Fri, 23 Apr 2010 15:46:41 GMT</pubDate><dc:creator>bloveall</dc:creator><description>&lt;p&gt;Thanks Handy. That is helpful.&lt;/p&gt;</description></item><item><title>Column removal on some columns but not others</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Column-removal-on-some-columns-but-not-others/</link><pubDate>Fri, 23 Apr 2010 13:14:12 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hi Brad,&lt;/p&gt;&lt;p&gt;Sure, you can validate at OnColumnMove clientside event.&lt;br /&gt;Here is the sample of my snippet codes.&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;function WebGrid1_OnColumnMove(controlId, tblName, sourceIndex, targetIndex, sourceColumn, targetColumn)
{
	var WebGrid1 = ISGetObject(controlId);
	if (sourceColumn.Name == "checkbox1" || targetColumn.Name == "checkbox1") {
		return false;
	}
	return true;
}&lt;/pre&gt;
&lt;p&gt;If the current column is also in ColumnContextMenu, you can validate at OnColumnContextMenu client side event. (this feature only available in WebGrid 7)&lt;br /&gt;Here is the sample of my snippet codes.&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;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;
}&lt;/pre&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Column removal on some columns but not others</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Column-removal-on-some-columns-but-not-others/</link><pubDate>Fri, 23 Apr 2010 11:32:28 GMT</pubDate><dc:creator>bloveall</dc:creator><description>&lt;p&gt;Handy,&lt;/p&gt;
&lt;p&gt;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?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Brad &lt;/p&gt;</description></item><item><title>Column removal on some columns but not others</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Column-removal-on-some-columns-but-not-others/</link><pubDate>Fri, 23 Apr 2010 11:27:58 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello Brad,&lt;/p&gt;&lt;p&gt;Defaultly, our WebGrid could not move or do select/unselect Column if AllowColumnMoving or AllowColumnSelect is set into false. &lt;br /&gt;So, please ensure those properties are not set true.&lt;br /&gt;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. &lt;br /&gt;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.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Column removal on some columns but not others</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Column-removal-on-some-columns-but-not-others/</link><pubDate>Fri, 23 Apr 2010 09:15:07 GMT</pubDate><dc:creator>bloveall</dc:creator><description>&lt;p&gt;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?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Brad&lt;/p&gt;</description></item></channel></rss>