﻿<?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 - dropdown</title><link>http://www.intersoftsolutions.com/Community/WebGrid/dropdown/</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>dropdown</title><link>http://www.intersoftsolutions.com/Community/WebGrid/dropdown/</link><pubDate>Thu, 02 Jun 2011 23:43:58 GMT</pubDate><dc:creator>yudi</dc:creator><category>dropDown List value</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;Glad to hear the good news.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.&lt;/span&gt;</description></item><item><title>dropdown</title><link>http://www.intersoftsolutions.com/Community/WebGrid/dropdown/</link><pubDate>Tue, 31 May 2011 11:42:13 GMT</pubDate><dc:creator>quipex</dc:creator><category>dropDown List value</category><description>&lt;p&gt;I found the solution by myself.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If you use DataTable as Datasource then specify the type of column like this:&lt;/p&gt;&lt;pre&gt;            DataTable parts = new DataTable();

            parts.Columns.AddRange(new DataColumn[]{
                new DataColumn("DienstleistungID", typeof(long)),
                new DataColumn("Bezeichnung")
            });&lt;/pre&gt;
</description></item><item><title>dropdown</title><link>http://www.intersoftsolutions.com/Community/WebGrid/dropdown/</link><pubDate>Tue, 31 May 2011 10:33:03 GMT</pubDate><dc:creator>quipex</dc:creator><category>dropDown List value</category><description>&lt;p&gt;I have a problem with dropdown in webgrid. The grid shows sometimes the id instead text. All list entries are available. See sreen!&lt;/p&gt;
&lt;p&gt;I use newest version of all libraries...webgrid is 7.0.7200.419&lt;/p&gt;
&lt;p&gt;This is code snippet where I create dropdown DataTable:&lt;/p&gt;&lt;pre&gt;    private DataTable DataPartDienstleistungen
    {
        get
        {
            DataTable parts = new DataTable();

            parts.Columns.AddRange(new DataColumn[]{
                new DataColumn("DienstleistungID"),
                new DataColumn("Bezeichnung")
            });

            Dienstleistungsart dienstleistungsart = DaoFactory.Instance.DienstleistungsartDao.Get(long.Parse(DienstleistungsartID.Value));
            if (dienstleistungsart != null)
            {
                IList&amp;lt;Dienstleistung&amp;gt; list = dienstleistungsart.Dienstleistungen;
                foreach (Dienstleistung d in list)
                {
                    if (d.Mengeneinheit != Mengeneinheit.Basket)
                    {
                        parts.Rows.Add(new object[] { d.ID, d.Bezeichnung });
                    }
                }
            }
            return parts;
        }
    }


    protected void Webgrid_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)
    {
        WebGridTable basketTable = WebGrid1.GetTableByName("BasketdienstleistungCollection");
        basketTable.AllowAddNew = AddNew.Yes;
        basketTable.AllowEdit = Edit.Yes;
        basketTable.AllowDelete = Delete.Yes;
        basketTable.AllowSorting = Sorting.Yes;


        WebValueList list = basketTable.Columns.GetNamedItem("PartDienstleistungID").ValueList;
        list.DataSource = DataPartDienstleistungen;
        list.DataTextField = "Bezeichnung";
        list.DataValueField = "DienstleistungID";

    }&lt;/pre&gt;

&lt;p&gt;This is code snippet of page:&lt;/p&gt;&lt;pre&gt;&amp;lt;div style="height: 300px;"&amp;gt;
        &amp;lt;ISWebGrid:WebGrid ID="WebGrid1" runat="server" DefaultStyleMode="Silver" Height="210"
            AllowAutoDataCaching="false" UseDefaultStyle="True" Width="100%" OnInitializeRow="Webgrid_InitializeRow"
            DataMember="DienstleistungCollection" DataSourceID="ISDataSource1" OnInitializeLayout="Webgrid_InitializeLayout"&amp;gt;
            &amp;lt;LayoutSettings AllowAddNew="No" AllowColumnSizing="No" AllowDelete="No" AllowEdit="No"
                EditOnClick="true" StatusBarVisible="false" AllowSorting="Default" Hierarchical="True"
                TreeLines="false"&amp;gt;
                &amp;lt;TextSettings Language="UseCulture"&amp;gt;
                &amp;lt;/TextSettings&amp;gt;
            &amp;lt;/LayoutSettings&amp;gt;
            &amp;lt;RootTable Caption="DienstleistungCollection" DataKeyField="DienstleistungID" DataMember="DienstleistungCollection"
                RowHeaders="No" ColumnHeaders="No"&amp;gt;
                &amp;lt;ChildTables&amp;gt;
                    &amp;lt;ISWebGrid:WebGridTable Caption="BasketdienstleistungCollection" DataKeyField="BasketdienstleistungID"
                        DataMember="BasketdienstleistungCollection"&amp;gt;
                        &amp;lt;Columns&amp;gt;
                            &amp;lt;ISWebGrid:WebGridColumn Caption="BasketdienstleistungID" DataMember="BasketdienstleistungID"
                                DataType="System.Int64" Name="BasketdienstleistungID" Visible="false" DefaultValue="0"&amp;gt;
                            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
                            &amp;lt;ISWebGrid:WebGridColumn Caption="DienstleistungID" DataMember="DienstleistungID"
                                DataType="System.Int64" Name="DienstleistungID" Visible="false"&amp;gt;
                            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
                            &amp;lt;ISWebGrid:WebGridColumn Caption="Anzahl" DataMember="Anzahl" DataType="System.Int32"
                                Name="Anzahl" TextboxMaxlength="5"&amp;gt;
                            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
                            &amp;lt;ISWebGrid:WebGridColumn Caption="Dienstleistung" DataMember="PartDienstleistungID"
                                DataType="System.Int64" Name="PartDienstleistungID" EditType="DropdownList" Width="200"
                                InputRequired="true"&amp;gt;
                            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
                        &amp;lt;/Columns&amp;gt;
                    &amp;lt;/ISWebGrid:WebGridTable&amp;gt;
                &amp;lt;/ChildTables&amp;gt;
                &amp;lt;Columns&amp;gt;
                    &amp;lt;ISWebGrid:WebGridColumn Caption="DienstleistungID" DataMember="DienstleistungID"
                        DataType="System.Int64" Name="DienstleistungID" Visible="false"&amp;gt;
                    &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
                    &amp;lt;ISWebGrid:WebGridColumn Caption="Bezeichnung" DataMember="Bezeichnung" Name="Bezeichnung"
                        Width="200"&amp;gt;
                    &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
                &amp;lt;/Columns&amp;gt;
            &amp;lt;/RootTable&amp;gt;
        &amp;lt;/ISWebGrid:WebGrid&amp;gt;&lt;/pre&gt;
</description></item></channel></rss>