Intersoft WebUI Studio.NET 2007控件使用

原创|其它|编辑:郝浩|2007-08-24 10:01:51.000|阅读 1819 次

概述:使用 WebGrid 控件时遇到的问题及解决方法

# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>

我在使用  WebGrid  控件时遇到的问题及解决方法:

1.   webgrid    RowChanged  事件没有相应

解决:客户端代码中<LayoutSettings AllowAddNew="Yes" AllowDelete="Yes" AllowEdit="Yes" RowChangedAction="OnTheFlyPostback">

              </LayoutSettings>
               
设置RowChangedAction="OnTheFlyPostback

 

2.   客户端事件在哪里添加

解决:<LayoutSettings AllowAddNew="Yes" AllowDelete="Yes" AllowEdit="Yes" RowChangedAction="OnTheFlyPostback">

                                        <ClientSideEvents OnRowValidate="wgUserRole_OnRowValidate" />

                                        </LayoutSettings>

              ClientSideEvents  中可以添加客户端事件

 

3.  WebGrid  的列内容唯一
"
解决: 因为我们是通过datatable绑定的。。绑定前  DataColumn  设置列.Unique = true

 

4.  隐藏一列

解决:把改列的宽设置为 0px

 

5.    WebGrid  控件中,设置该列的  EditType="NoEdit"过后,通过  UI  中自带的新增行功能是不能录入信息的

解决

protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)

    {

        if (e.Row.Type == ISNet.WebUI.WebGrid.RowType.NewRecord)

            e.Row.Cells.GetNamedItem("bm").ForceNoEdit = false;

        else

            e.Row.Cells.GetNamedItem("bm").ForceNoEdit = true;

    }

 

6.   WebGrid  的列无法绑定下拉框(前提  WebGrid  是通过服务段代码绑定的数据源)

解决:

1  在设置数据时先设置数据源(dt  为表名)然后设置邦定的类型、控件的名称和显示的值等。

2  设置邦定控件的数据源(dy  为表名)和显示值等。

3  邦定数据到相应得控件。(下面是部分代码)

 

        this.WebGrid1.DataSource = dt;

        this.WebGrid1.RootTable.Columns[1].EditType = ISNet.WebUI.WebGrid.EditType.WebComboNET;

        this.WebGrid1.RootTable.Columns[1].WebComboID = "WebCombo1";

        this.WebGrid1.RootTable.Columns[1].ValueList.DataTextField = "CompanyName";

        this.WebGrid1.RootTable.Columns[1].ValueList.DataValueField = "CustomerID";

 

        this.WebCombo1.DataSource = dy;

        this.WebCombo1.DataTextField = "CompanyName";

        this.WebCombo1.DataValueField = "CustomerID";

        WebGrid1.DataBind();

        WebCombo1.DataBind();


标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com

文章转载自:csdn

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP