﻿<?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 - Readonly column(EditType = EditType.DropdownList) should show datatext field </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Readonly-columnEditType--EditTypeDropdownList-should-show-datatext-field/</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>Readonly column(EditType = EditType.DropdownList) should show datatext field </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Readonly-columnEditType--EditTypeDropdownList-should-show-datatext-field/</link><pubDate>Tue, 11 Oct 2016 08:05:54 GMT</pubDate><dc:creator>yudi</dc:creator><category>readonly</category><category>EditType.DropdownList</category><category>textfield</category><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Thank you for the sent sample. I can reproduce the reported problem using the sample.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I’m currently still investigating this issue and need more time to provide you with solution, suggestion, or sample.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I’ll get back to you as soon as possible.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Readonly column(EditType = EditType.DropdownList) should show datatext field </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Readonly-columnEditType--EditTypeDropdownList-should-show-datatext-field/</link><pubDate>Wed, 28 Sep 2016 08:56:12 GMT</pubDate><dc:creator>sjain</dc:creator><category>readonly</category><category>EditType.DropdownList</category><category>textfield</category><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;Coule please give us solution ASAP, Please?&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Regards&lt;/p&gt;&lt;p&gt;Sachin Jain&lt;br&gt;&lt;/p&gt;</description></item><item><title>Readonly column(EditType = EditType.DropdownList) should show datatext field </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Readonly-columnEditType--EditTypeDropdownList-should-show-datatext-field/</link><pubDate>Tue, 20 Sep 2016 15:02:58 GMT</pubDate><dc:creator>sjain</dc:creator><category>readonly</category><category>EditType.DropdownList</category><category>textfield</category><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;Thanks for the reply&lt;/p&gt;&lt;p&gt;I used client side to make column readonly with following code given by you:&lt;/p&gt;&lt;p&gt;&lt;i&gt;function ToggleColumnEdit() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // retrieves WebGrid's object&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var grid = ISGetObject("WebGrid1");&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // access WebGrid's RootTable&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var rootTable = grid.RootTable;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var columnSupplierID = rootTable.GetColumn("SupplierID");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var columnCategoryID = rootTable.GetColumn("CategoryID");&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; columnSupplierID.EditType = "NoEdit";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; columnCategoryID.EditType = "NoEdit";&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;br&gt;}&lt;/i&gt;&lt;/p&gt;&lt;div&gt;&lt;i&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/i&gt;&lt;/div&gt;&lt;div&gt;Issue 1: Filter is not working based on datatext field of column which is made as readonly.&lt;/div&gt;&lt;div&gt;issue 2: when clear the filter it is bound with datavalue field.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Please see my 5 images attached as test case.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I attached the code with sample database.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Please reply ASAP.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks&lt;/div&gt;&lt;div&gt;Sachin Jain&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;/i&gt;&lt;b&gt;&lt;/b&gt;&lt;u&gt;&lt;/u&gt;&lt;sub&gt;&lt;/sub&gt;&lt;sup&gt;&lt;/sup&gt;&lt;strike&gt;&lt;br&gt;&lt;/strike&gt;&lt;/div&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description></item><item><title>Readonly column(EditType = EditType.DropdownList) should show datatext field </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Readonly-columnEditType--EditTypeDropdownList-should-show-datatext-field/</link><pubDate>Fri, 16 Sep 2016 03:41:24 GMT</pubDate><dc:creator>yudi</dc:creator><category>readonly</category><category>EditType.DropdownList</category><category>textfield</category><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I started my investigation by modifying BindWebValueListtoISDataSource.aspx sample file of WebGrid. The live version of this sample is in &lt;a href="http://live.intersoftsolutions.com/cs/WebGrid/BindWebValueListtoISDataSource.aspx?noframe=1" target="_blank"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;The &lt;strong&gt;SupplierID&lt;/strong&gt; and &lt;strong&gt;CategoryID&lt;/strong&gt; column of the sample are having column edit type as DropdownList. I tested the reported problem by using following approach:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;&lt;strong&gt;Set column's EditType to NoEdit using OnInitializeColumn server-side event.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;OnInitializeColumn server-side event is invoked when WebGridColumn needs to be initialized during data binding. Following snippet code is used to set the column as read-only.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;protected void WebGrid1_InitializeColumn(object sender, ColumnEventArgs e)
{
    if (e.Column.Name == "SupplierID" || e.Column.Name=="CategoryID")
    {
        e.Column.EditType = EditType.NoEdit;
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Result: column shows datatext field of dropdownlist.&lt;/span&gt;&lt;/p&gt;&lt;br&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;&lt;strong&gt;Set cell's ForceNoEdit to true using OnInitializeRow server-side event.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;OnInitializeRow server-side event is invoked when a WebGridRow need to initialized during data binding. Following snippet code is used to set the cell as read-only.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
{
    if (e.Row.Type==RowType.Record)
    {
        if (e.Row.KeyValue.ToString() == "1")
        {
            e.Row.Cells.GetNamedItem("SupplierID").ForceNoEdit = true;
            e.Row.Cells.GetNamedItem("CategoryID").ForceNoEdit = true;
        }
    }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Result: column shows datatext field of dropdownlist.&lt;/span&gt;&lt;/p&gt;&lt;br&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;&lt;strong&gt;Set columns's EditType to NoEdit using JavaScript function.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Following snippet code is used to set the column's EditType to NoEdit.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;function ToggleColumnEdit() {
    // retrieves WebGrid's object
    var grid = ISGetObject("WebGrid1");

    // access WebGrid's RootTable
    var rootTable = grid.RootTable;

    var columnSupplierID = rootTable.GetColumn("SupplierID");
    var columnCategoryID = rootTable.GetColumn("CategoryID");

    columnSupplierID.EditType = "NoEdit";
    columnCategoryID.EditType = "NoEdit";

    return true;
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Result: column shows datatext field of dropdownlist.&lt;/span&gt;&lt;/p&gt;&lt;br&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;&lt;strong&gt;Invoke SetForceNoEdit(true) of the cell using JavaScript function.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Following snippet code is used to set the cell to read-only.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;function ToggleNewRowEdit() {
    // retrieves WebGrid's object
    var grid = ISGetObject("WebGrid1");

    // retrieves first row object
    var firstRow = grid.RootTable.GetRow(0);

    firstRow.GetCell("SupplierID").SetForceNoEdit(true);
    firstRow.GetCell("CategoryID").SetForceNoEdit(true);

    return true;
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Result: column shows datatext field of dropdownlist.&lt;/span&gt;&lt;/p&gt;&lt;br&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I was unable to reproduce the reported problem using these techniques.&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;When we mark column(having column edit type as dropdownlist EditType = EditType.DropdownList;) as readonly, then datavalue field is shown.&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I would need you to elaborate on your specific scenario and possibly give me a running simple sample of WebGrid and step-by-step guide that I can use to observe the problem.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Readonly column(EditType = EditType.DropdownList) should show datatext field </title><link>http://www.intersoftsolutions.com/Community/WebGrid/Readonly-columnEditType--EditTypeDropdownList-should-show-datatext-field/</link><pubDate>Thu, 15 Sep 2016 14:02:35 GMT</pubDate><dc:creator>sjain</dc:creator><category>readonly</category><category>EditType.DropdownList</category><category>textfield</category><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;When we mark column(having column edit type as dropdownlist EditType = EditType.DropdownList;)  as&lt;/p&gt;&lt;p&gt;readonly, then datavalue field is shown.&lt;/p&gt;&lt;p&gt;how to make when column makred as readonly then datatext field show of doropdownlist not datavalue field?&lt;/p&gt;&lt;p&gt;Please reply ASAP.&lt;/p&gt;&lt;p&gt;Regards&lt;/p&gt;&lt;p&gt;Sachin Jain&lt;b&gt;&lt;/b&gt;&lt;i&gt;&lt;/i&gt;&lt;u&gt;&lt;/u&gt;&lt;sub&gt;&lt;/sub&gt;&lt;sup&gt;&lt;/sup&gt;&lt;strike&gt;&lt;/strike&gt;&lt;br&gt;&lt;/p&gt;</description></item></channel></rss>