﻿<?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 - how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</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>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Sun, 03 Jun 2012 21:43:12 GMT</pubDate><dc:creator>bernard</dc:creator><description>&lt;p&gt;Hi su su,&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Glad to hear that you have solved the problem. For references of WebGrid, you can see the tutorial video at &lt;a href="http://intersoftpt.com/Support/WebGrid/Tutorial/" style="font-size: 10pt; "&gt;http://intersoftpt.com/Support/WebGrid/Tutorial/&lt;/a&gt; . And if you have any further question, please don't hesitate to ask us. We will gladly assist you.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Bernard&lt;/p&gt;</description></item><item><title>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Sun, 03 Jun 2012 21:24:55 GMT</pubDate><dc:creator>susu</dc:creator><description>&lt;p&gt;Hi Bernard,&lt;/p&gt;
&lt;p&gt;thank you very much! I have solve my doubtful point now! if  I want to trigger the event &lt;span style="text-align: left; line-height: 18px; background-color: rgb(255,255,255); font-family: 'segoe ui', arial, verdana, tahoma; color: rgb(63,63,63); font-size: 12px"&gt;oninitializedatasource="WebGrid1_InitializeDataSource"&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;span style="text-align: left; line-height: 18px; background-color: rgb(255,255,255); font-family: 'segoe ui', arial, verdana, tahoma; color: rgb(63,63,63); font-size: 12px"&gt;oninitializelayout="WebGrid1_InitializeLayout1"&amp;nbsp;&lt;/span&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="text-align: left; line-height: 18px; background-color: rgb(255,255,255); font-family: 'segoe ui', arial, verdana, tahoma; color: rgb(63,63,63); font-size: 12px"&gt;onpreparedatabinding="WebGrid1_PrepareDataBinding1"&amp;nbsp;, and set NoEdit,I want to set like this :&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="text-align: left; line-height: 18px; background-color: rgb(255,255,255); font-family: 'segoe ui', arial, verdana, tahoma; color: rgb(63,63,63); font-size: 12px"&gt;&lt;span style="font-size: 13px"&gt; &lt;b&gt;WebGrid1.RootTable.Columns[0].EditType = EditType.NoEdit;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="text-align: left; line-height: 18px; background-color: rgb(255,255,255); font-family: 'segoe ui', arial, verdana, tahoma; color: rgb(63,63,63); font-size: 12px"&gt;&lt;span style="font-size: 13px"&gt;if I don't write code,just set EditType=NoEdit in ~.aspx .Thank  you very much!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</description></item><item><title>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Fri, 01 Jun 2012 07:06:16 GMT</pubDate><dc:creator>bernard</dc:creator><description>Hi su su,&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;My code is the replicate of your code above. In your code above I didn't see &lt;span style="background-color: rgb(255, 255, 255); color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; text-align: left; "&gt;oninitializedatasource="WebGrid1_InitializeDataSource"&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; text-align: left; background-color: rgb(255, 255, 255); "&gt;oninitializelayout="WebGrid1_InitializeLayout1"&amp;nbsp;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; text-align: left; background-color: rgb(255, 255, 255); "&gt;onpreparedatabinding="WebGrid1_PrepareDataBinding1"&amp;nbsp;&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;so I assume server-side code is not triggered because you don't have any handler in you snippet above.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;If you have bind the database into ISDataSource1 (the codeless data binding), you shouldn't bind the database on your server-side too. Please read my post above. &lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;In your code, if you want to set NoEdit, you should put it on PrepareDataBinding event.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;Here's the code:&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;protected void WebGrid1_PrepareDataBinding(object sender, DataSourceEventArgs e)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;    {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;        if (!IsPostBack)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;        {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;            WebGrid1.RetrieveStructure();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;        }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;        if (WebCombo1.Text != "")&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;        {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;            WebGridFilter a = new WebGridFilter();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;            a.ColumnMember = "UnitsInStock";&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;            a.FilterType = ISNet.WebUI.WebGrid.ColumnFilterType.EqualTo;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;            a.FilterText = WebCombo1.Text;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;            WebGrid1.RootTable.FilteredColumns.Add(a);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;            if (WebCombo2.Text != "")&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;            {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;                WebGridFilter b = new WebGridFilter();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;                b.ColumnMember = "UnitsOnOrder";&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;                b.FilterType = ISNet.WebUI.WebGrid.ColumnFilterType.EqualTo;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;                b.FilterText = WebCombo2.Text;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;                WebGrid1.RootTable.FilteredColumns.Add(b);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;            }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;        }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;        &lt;b&gt;WebGrid1.RootTable.Columns[0].EditType = EditType.NoEdit;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span id="tempFont" style="font-size: 10pt; "&gt;Hope this helps.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; "&gt;Regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; "&gt;Bernard&amp;nbsp;&lt;/span&gt;&lt;/div&gt;</description></item><item><title>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Thu, 31 May 2012 23:54:46 GMT</pubDate><dc:creator>susu</dc:creator><description>&lt;p&gt;Hi Bernard,&lt;/p&gt;
&lt;p&gt;I have seen your sample,you wrote the filter code in behind,you didn't trigger the event such as InitializeDatabase PrepareDatabind and InitializeLayout,so they don't excute the filter code?&lt;/p&gt;
&lt;p&gt;for my before code  it has oninitializedatasource="WebGrid1_InitializeDataSource"  &lt;/p&gt;
&lt;p&gt;           oninitializelayout="WebGrid1_InitializeLayout1" &lt;br /&gt;            onpreparedatabinding="WebGrid1_PrepareDataBinding1" ,your codes don't has these event, would you please have a try? thank you very much!&lt;/p&gt;</description></item><item><title>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Thu, 31 May 2012 07:22:05 GMT</pubDate><dc:creator>bernard</dc:creator><description>&lt;p /&gt;&lt;p class="MsoNormal"&gt;Hi su su,&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;I still can’t replicate your issue in our local end. But
from your information, the server-side code is not executed because you doesn’t
set the event handler on design view. If you have bind the database in design view, you don't need to bind the database programmatically. From your information, I’ve made my own
sample which have the same structure as yours. In my sample I use Northwind as my database and my DataSet If you don’t mind, could you
edit my sample to replicate your issue in my sample? Look forward to heard any
news from you so we can assist you further.&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Regards,&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Bernard&lt;o:p /&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Thu, 31 May 2012 00:53:46 GMT</pubDate><dc:creator>susu</dc:creator><description>&lt;p&gt;Hi Bernard,&lt;/p&gt;
&lt;p&gt;thank you for your help,but I still have some doubts,for example:I make a grid ,it has some columns,such as StuNo,StuName,StuSex,StuGrade,StuClass,StuTelNo,StuAdd,now I want to set  the property of StuNo to EditType="NoEdit",see the before codes as follows, &lt;/p&gt;
&lt;p&gt;&amp;lt;ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="301px" &lt;br /&gt;        UseDefaultStyle="True" Width="813px" DataSourceID="ISDataSource1" &lt;br /&gt;            DataMember="BIAO" DefaultStyleMode="Elegant"&amp;gt; &lt;br /&gt;        &amp;lt;RootTable DataKeyField="StuNo" Caption="BIAO" DataMember="BIAO" ColumnFooters="Yes"&amp;gt;&lt;br /&gt;            &amp;lt;Columns&amp;gt;&lt;br /&gt;                &amp;lt;ISWebGrid:WebGridColumn Caption="StuNo" DataMember="StuNo" Name="StuNo" &lt;strong&gt;EditType="NoEdit" &lt;br /&gt;&lt;/strong&gt;                    Width="100px" AggregateFunction="Count" FooterText="总学生数"&amp;gt;&lt;br /&gt;                &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;br /&gt;                &amp;lt;ISWebGrid:WebGridColumn Caption="StuName" DataMember="StuName" Name="StuName" &lt;br /&gt;                    Width="100px"&amp;gt;&lt;br /&gt;                &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;br /&gt;                &amp;lt;ISWebGrid:WebGridColumn Caption="StuSex" DataMember="StuSex" Name="StuSex" &lt;br /&gt;                    Width="100px" EditType="WebComboNET" WebComboID="WebCombo3"&amp;gt;&lt;br /&gt;                    &amp;lt;ValueList DataMember="TbSex1" DataTextField="StuSex" DataSourceID="ISDataSource1" DataValueField="StuSex"&amp;gt;&lt;br /&gt;                    &amp;lt;/ValueList&amp;gt;&lt;br /&gt;                &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;br /&gt;                &amp;lt;ISWebGrid:WebGridColumn Caption="StuGrade" DataMember="StuGrade"&lt;br /&gt;                    Name="StuGrade" Width="100px" EditType="WebComboNET" &lt;br /&gt;                    WebComboID="WebCombo1"&amp;gt;&lt;br /&gt;                &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;br /&gt;                &amp;lt;ISWebGrid:WebGridColumn Caption="StuClass" DataMember="StuClass" &lt;br /&gt;                    Name="StuClass" Width="100px" EditType="WebComboNET" &lt;br /&gt;                    WebComboID="WebCombo2"&amp;gt;&lt;br /&gt;                    &amp;lt;ValueList DataMember="TbClass" DataSourceID="ISDataSource1" &lt;br /&gt;                        DataTextField="StuClass" DataValueField="StuClass"&amp;gt;&lt;br /&gt;                    &amp;lt;/ValueList&amp;gt;&lt;br /&gt;                &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;br /&gt;                &amp;lt;ISWebGrid:WebGridColumn Caption="StuTelNo" DataMember="StuTelNo" Name="StuTelNo" &lt;br /&gt;                    Width="100px"&amp;gt;&lt;br /&gt;                &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;br /&gt;                &amp;lt;ISWebGrid:WebGridColumn Caption="StuAdd" DataMember="StuAdd" &lt;br /&gt;                    Name="StuAdd" Width="100px"&amp;gt;&lt;br /&gt;                &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;br /&gt;                &amp;lt;ISWebGrid:WebGridColumn Caption="ExistFlag" DataMember="ExistFlag" &lt;br /&gt;                    Name="ExistFlag" Width="100px"&amp;gt;&lt;br /&gt;                &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;br /&gt;            &amp;lt;/Columns&amp;gt;&lt;br /&gt;        &amp;lt;/RootTable&amp;gt;&lt;br /&gt;        &amp;lt;LayoutSettings AllowDelete="Yes" AllowContextMenu="true" AllowEdit="Yes" AllowAddNew="Yes" AllowFilter="Yes" PagingMode="ClassicPaging" AllowExport="Yes"&amp;gt;&lt;br /&gt;        &amp;lt;/LayoutSettings&amp;gt;&lt;br /&gt;    &amp;lt;/ISWebGrid:WebGrid&amp;gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I write a filter code in behind:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;        protected void WebGrid1_InitializeDataSource(object sender, DataSourceEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            SqlConnection sqlcon = new SqlConnection("Data Source = (local); Database = su; Uid = sa; Pwd = sss123456;");&lt;br /&gt;            string SqlStr = "select * from BIAO";&lt;br /&gt;            SqlDataAdapter da = new SqlDataAdapter(SqlStr, sqlcon);&lt;br /&gt;            DataSet ds = new DataSet();&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                sqlcon.Open();&lt;br /&gt;                da.Fill(ds);&lt;br /&gt;                e.DataSource = ds;&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ee)&lt;br /&gt;            {&lt;br /&gt;                Response.Write(ee.Message);&lt;br /&gt;            }&lt;br /&gt;            finally&lt;br /&gt;            {&lt;br /&gt;                sqlcon.Close();&lt;br /&gt;            }&lt;br /&gt;        }&lt;/p&gt;
&lt;p&gt;        protected void WebGrid1_PrepareDataBinding(object sender, DataSourceEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (!IsPostBack)&lt;br /&gt;            {&lt;br /&gt;                WebGrid1.RetrieveStructure();&lt;br /&gt;            }&lt;br /&gt;            if (WebCombo1.Text != "")&lt;br /&gt;            {&lt;br /&gt;                WebGridFilter a = new WebGridFilter();&lt;br /&gt;                a.ColumnMember = "StuGrade";&lt;br /&gt;                a.FilterType = ISNet.WebUI.WebGrid.ColumnFilterType.EqualTo;&lt;br /&gt;                a.FilterText = WebCombo1.Text;&lt;br /&gt;                WebGrid1.RootTable.FilteredColumns.Add(a);&lt;br /&gt;                if (WebCombo2.Text != "")&lt;br /&gt;                {&lt;/p&gt;
&lt;p&gt;                    WebGridFilter b = new WebGridFilter();&lt;br /&gt;                    b.ColumnMember = "StuClass";&lt;br /&gt;                    b.FilterType = ISNet.WebUI.WebGrid.ColumnFilterType.EqualTo;&lt;br /&gt;                    b.FilterText = WebCombo2.Text;&lt;br /&gt;                    WebGrid1.RootTable.FilteredColumns.Add(b);&lt;br /&gt;                }&lt;br /&gt;            }&lt;/p&gt;
&lt;p&gt;        }&lt;/p&gt;
&lt;p&gt;        protected void WebGrid1_InitializeLayout(object sender, LayoutEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            e.Layout.AllowFilter = ISNet.WebUI.WebGrid.Filter.Yes;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;        }&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;now i just konw that the filter code cause the StuNo's NoEdit didn't work,it still can editable,but i don't konw why,are they&amp;nbsp; have some conflict when&amp;nbsp;they used at the same time,would please give me some ideas? thank yo very much!&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Thu, 31 May 2012 00:24:56 GMT</pubDate><dc:creator>bernard</dc:creator><description>&lt;p /&gt;&lt;p class="MsoNormal"&gt;Hi su su,&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;I’ve look on your code and I didn’t see the EditType there.&lt;span style="color: rgb(31, 73, 125); "&gt; &lt;/span&gt;Where do you want to put the EditType property?
For the filtering, is the WebCombo will integrated to WebGrid? If you want
WebCombo’s value cannot be edited, you can do it with changing TextBoxMode
property on Layout Settings to ReadOnly value. For WebGrid Column, &lt;span style="color: rgb(31, 73, 125); "&gt;i&lt;/span&gt;f you want to set EditType on WebGrid, you can
put it on PrepareDataBinding event. PrepareDataBinding event executed when
WebGrid retrieve the column structure and create necessary object.&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;I’ve made my own sample. In my sample, I using Northwind as
my project’s Database and DataSet. I also put Unbound WebCombo as Filter Type.
Hope this helps.&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Regards,&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Bernard&lt;o:p /&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Wed, 30 May 2012 00:50:31 GMT</pubDate><dc:creator>susu</dc:creator><description>&lt;p&gt;Hi Bernard,&lt;/p&gt;
&lt;p&gt;I have found the problem that make the setting noedit not work,i wrote a filter code behind in initializedatasource,preparedatabind and initializelayout,such as follows:&lt;/p&gt;
&lt;p&gt;        protected void WebGrid1_InitializeDataSource(object sender, DataSourceEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            SqlConnection sqlcon = new SqlConnection("Data Source = (local); Database = su; Uid = sa; Pwd = sss123456;");&lt;br /&gt;            string SqlStr = "select * from BIAO";&lt;br /&gt;            SqlDataAdapter da = new SqlDataAdapter(SqlStr, sqlcon);&lt;br /&gt;            DataSet ds = new DataSet();&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                sqlcon.Open();&lt;br /&gt;                da.Fill(ds);&lt;br /&gt;                e.DataSource = ds;&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ee)&lt;br /&gt;            {&lt;br /&gt;                Response.Write(ee.Message);&lt;br /&gt;            }&lt;br /&gt;            finally&lt;br /&gt;            {&lt;br /&gt;                sqlcon.Close();&lt;br /&gt;            }&lt;br /&gt;        }&lt;/p&gt;
&lt;p&gt;        protected void WebGrid1_PrepareDataBinding(object sender, DataSourceEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (!IsPostBack)&lt;br /&gt;            {&lt;br /&gt;                WebGrid1.RetrieveStructure();&lt;br /&gt;            }&lt;br /&gt;            if (WebCombo1.Text != "")&lt;br /&gt;            {&lt;br /&gt;                WebGridFilter a = new WebGridFilter();&lt;br /&gt;                a.ColumnMember = "StuGrade";&lt;br /&gt;                a.FilterType = ISNet.WebUI.WebGrid.ColumnFilterType.EqualTo;&lt;br /&gt;                a.FilterText = WebCombo1.Text;&lt;br /&gt;                WebGrid1.RootTable.FilteredColumns.Add(a);&lt;br /&gt;                if (WebCombo2.Text != "")&lt;br /&gt;                {&lt;/p&gt;
&lt;p&gt;                    WebGridFilter b = new WebGridFilter();&lt;br /&gt;                    b.ColumnMember = "StuClass";&lt;br /&gt;                    b.FilterType = ISNet.WebUI.WebGrid.ColumnFilterType.EqualTo;&lt;br /&gt;                    b.FilterText = WebCombo2.Text;&lt;br /&gt;                    WebGrid1.RootTable.FilteredColumns.Add(b);&lt;br /&gt;                }&lt;br /&gt;            }&lt;/p&gt;
&lt;p&gt;        }&lt;/p&gt;
&lt;p&gt;        protected void WebGrid1_InitializeLayout(object sender, LayoutEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            e.Layout.AllowFilter = ISNet.WebUI.WebGrid.Filter.Yes;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;        }&lt;/p&gt;
&lt;p&gt;when i open these codes,the properties of one column NoEdit that does not work,it still can edit.i don't konw why ,would please give me a hand,thanks very much!&lt;/p&gt;</description></item><item><title>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Wed, 30 May 2012 00:31:59 GMT</pubDate><dc:creator>bernard</dc:creator><description>&lt;p /&gt;&lt;p class="MsoNormal"&gt;Hi su su,&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;If you want to make the column can’t be edited, you can just
set the EditType=”NoEdit”. But maybe in your case the EditType property is
setted in wrong tag so that make the column still can be edited.&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;For the second case, I’ve made my own sample using Northwind
as project’s database. You can make unbound column on bound WebGrid. But when
you edit the unbound column, the value will be lost because it is not stored in
database and the WebGrid refresh itself after updating process.&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;However it is possible to use unbound data in combo. I
enclose a sample about how to use unbound WebCombo which integrate into
WebGrid. In this case, I configure it in Discontinued column.&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Hope this helps.&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Regards,&lt;o:p /&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Bernard&lt;o:p /&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>how to set webcombo value in grid without using binding to database.</title><link>http://www.intersoftsolutions.com/Community/WebGrid/how-to-set-webcombo-value-in-grid-without-using-binding-to-database/</link><pubDate>Mon, 28 May 2012 22:49:45 GMT</pubDate><dc:creator>susu</dc:creator><description>&lt;p&gt;hi:&lt;/p&gt;
&lt;p&gt;1.i want to make one column's property in the grid that cant'n be edit,i know just set the edittype=noedit,but after set that, i still can edit that column.,why?&lt;br /&gt;2.i want to make a cell's style to be combo that the column value can be alternative in the grid,i have seen the samples,they are all make the column bind to data base ,but i don't want to make the column whose style is combo bind to data base ,i wonder if it can be just write the alternative values in the combo, and bind the combo to the grid  ,is this ok? how to realize this? thank you for your help,our company is the webui agent in china,i want to learn this,i am new for this~&lt;/p&gt;</description></item></channel></rss>