﻿<?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 - Dynamically Enabling/Disabled Columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Dynamically-EnablingDisabled-Columns/</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>Dynamically Enabling/Disabled Columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Dynamically-EnablingDisabled-Columns/</link><pubDate>Mon, 14 Jun 2010 14:31:50 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi John,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Glad to know it has solved your problem. Please do not hesitate to ask if you have any other questions. Thank you and have a nice day.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Dynamically Enabling/Disabled Columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Dynamically-EnablingDisabled-Columns/</link><pubDate>Mon, 14 Jun 2010 13:11:45 GMT</pubDate><dc:creator>JohnnyBravo</dc:creator><description>&lt;p&gt;This does it. Thank you very much....&lt;/p&gt;</description></item><item><title>Dynamically Enabling/Disabled Columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Dynamically-EnablingDisabled-Columns/</link><pubDate>Fri, 11 Jun 2010 16:37:33 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; "&gt;&lt;span style="font-size: 12px; " /&gt;&lt;/font&gt;&lt;/p&gt;&lt;font class="Apple-style-span" style="font-size: 15px; "&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 9pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;Hi John,&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 9pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;    Here
is the snippet to catch that event. We can use OnAfterExitEditMode of client
side event and make the validation in here. However, after we have lost focus
on those two columns(in your case, it would be quantities and minutes), those
two column will be editable again.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 9pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;    This
is happened because we only set those validation on after the user make a
selection of those drop down list. Here is the snippet:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 9pt; font-family: 'lucida sans unicode', sans-serif; color: black; " /&gt;&lt;/p&gt;&lt;pre&gt;        function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject)
        {
            var grid = ISGetObject(controlId);
            var RowObject = grid.GetSelectedObject().ToRowObject();
            if (editObject.cellElement.innerText == "USA")
            {
                RowObject.GetCells()[2].SetForceNoEdit(true);
                RowObject.GetCells()[3].SetForceNoEdit(true);
            }
            else
            {
                RowObject.GetCells()[2].SetForceNoEdit(false);
                RowObject.GetCells()[3].SetForceNoEdit(false);
            }
        }&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p /&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 9pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;     Same
as before, in this snippet, I made a validation if the dropdown list's value is
equal to USA, it will force no edit on those two columns. I hope it helps.
Thank you and have a nice day.&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 9pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;Best Regards,&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-size: 9pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;Andi Santoso&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'lucida sans unicode', sans-serif; color: black; "&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/font&gt;
&lt;p /&gt;</description></item><item><title>Dynamically Enabling/Disabled Columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Dynamically-EnablingDisabled-Columns/</link><pubDate>Fri, 11 Jun 2010 13:41:22 GMT</pubDate><dc:creator>JohnnyBravo</dc:creator><description>&lt;p&gt;Sorry Yudi, &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I am not using a WebCombo. I'm using a dropdown list object. ( EditType="DropdownList")&lt;/p&gt;
&lt;p&gt;How can I do this with a dropdown?&lt;/p&gt;</description></item><item><title>Dynamically Enabling/Disabled Columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Dynamically-EnablingDisabled-Columns/</link><pubDate>Fri, 11 Jun 2010 04:17:19 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I enclosed one simple sample of WebGrid based on your scenario.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;The grid binds to ‘Products’ table of Northwind database using ISDataSource control. There are four columns inside the grid, “ProductID”, “CategoryID”, “ProductName”, and “SupplierID”. “CategoryID” column uses value list so that the ‘CategoryName’ will be showed instead of the id.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Within the page, WebCombo is added. Combo binds to ‘Categories’ table of Northwind database using ISDataSource control and used as “CategoryID” column (of WebGrid) edit type.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;When user selects “Category” where the “CategoryID” value is odd (CategoryID = 1; or CategoryID = 3; and so on), then “ProductName” column will be disabled. When user selects “Category” where the “CategoryID” value is even (CategoryID = 2; or CategoryID = 4; and so on), then “SupplierID” column will be disabled.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;For more detail information, please check the attached sample.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Dynamically Enabling/Disabled Columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Dynamically-EnablingDisabled-Columns/</link><pubDate>Thu, 10 Jun 2010 14:43:45 GMT</pubDate><dc:creator>JohnnyBravo</dc:creator><description>&lt;p&gt;Ok, this seems to work. Now I have another question.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;What event is tied to when the user make a change to a cell (let's say they selected an option in a drop down list)? I also have to see that if they selected a specific option in the dropdown to not allow editing for certain columns....&lt;/p&gt;</description></item><item><title>Dynamically Enabling/Disabled Columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Dynamically-EnablingDisabled-Columns/</link><pubDate>Thu, 10 Jun 2010 13:49:04 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi John,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; After I read through your scenario, I believe we do not need to have the condition of when the user first starts to edit a record and when the users make a selection from dropdown list. We can simple use a client side of OnRowSelect and make a validation based on what is the value in the validation column.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; If it meets the validation, it will automatically set the edit to false. Here is the snippet on how to do so. In here, I make a validation if the Customer ID is "HANAR", the other two columns are not able to be edited.&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&lt;span style="font-size: 9pt; "&gt;  function WebGrid1_OnRowSelect(controlId, tblName, rowIndex, rowEl)
  {
    var grid = ISGetObject(controlId);
    if (grid.GetSelectedObject().ToRowObject().GetCells().GetNamedItem("CustomerID").Value == "HANAR")
    {
        grid.GetSelectedObject().ToRowObject().GetCells()[2].SetForceNoEdit(true);
        grid.GetSelectedObject().ToRowObject().GetCells()[3].SetForceNoEdit(true);
    }
  }&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;However, please let me know if it does not meet your scenario. Thank you and have a nice day.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Dynamically Enabling/Disabled Columns</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Dynamically-EnablingDisabled-Columns/</link><pubDate>Wed, 09 Jun 2010 18:03:27 GMT</pubDate><dc:creator>JohnnyBravo</dc:creator><description>&lt;p&gt;I'd like to disable/enable certain columns in my WebGrid dynamically depending on what the user selected. For Example.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Let's say there are 3 columns. One has a dropdown that has in the list Phone and Circuit. &lt;/p&gt;
&lt;p&gt;The other columns are for quantity and minutes. If the user selects Phone from the dropdown, I want to allow the user to enter values for quantity and minutes. If the user selects Circuit from the dropdown, quantity and minutes become disabled.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;How can I do this in JavaScript on the client side. This needs to happen when the user first starts to edit a record and then when the user makes a selection from the dropdown.&lt;/p&gt;</description></item></channel></rss>