第三方控件netadvantage UltraWebGrid总结

系统 1629 0

1.个人习惯前台绑定好实体字段,禁止自动生成;一些属性设置:AutoGenerateColumns="false"

 

 <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" Style="left: 0px; top: 0px;

                            height: 100%;" Width="100%" OnPageIndexChanged="UltraWebGrid1_PageIndexChanged"

                            OnInitializeLayout="UltraWebGrid1_InitializeLayout">

                            <DisplayLayout AutoGenerateColumns="false" ViewType="Hierarchical" AllowColSizingDefault="Free"

                                AllowDeleteDefault="Yes" HeaderClickActionDefault="SortMulti" Name="ctl02xUltraWebGrid1"

                                RowHeightDefault="20px" SelectTypeRowDefault="Extended" StationaryMargins="Header"

                                StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00" SelectTypeCellDefault="Single">

                                <HeaderStyleDefault HorizontalAlign="Center" TextOverflow="Ellipsis" VerticalAlign="Middle"

                                    BackColor="#BBEAF9" BorderStyle="Solid">

                                    <BorderDetails ColorLeft="#BBEAF9" ColorTop="#BBEAF9" WidthLeft="1px" WidthTop="1px">

                                    </BorderDetails>

                                </HeaderStyleDefault>

                                <RowStyleDefault TextOverflow="Ellipsis" BackColor="Window" BorderColor="Silver"

                                    BorderWidth="1px" BorderStyle="Solid" Font-Names="Microsoft Sans Serif" Font-Size="8.25pt">

                                    <Padding Left="3px"></Padding>

                                    <BorderDetails ColorLeft="Window" ColorTop="Window"></BorderDetails>

                                </RowStyleDefault>

                            </DisplayLayout>

 

------案例

 

 <igtbl:UltraGridColumn BaseColumnName="Id" HeaderText="Id" Key="Id" Hidden="true">

 </igtbl:UltraGridColumn>

 

如果实体嵌套实体就是包含关联实体的话不能像上面这样绑定了需要最原始的那种绑定:

 

 <igtbl:TemplatedColumn>

                                            <Header>

                                                <RowLayoutColumnInfo OriginX="1" OriginY="0" SpanY="4" />

                                            </Header>

                                            <HeaderTemplate>

                                                工程名称

                                            </HeaderTemplate>

                                            <CellTemplate>

                                                <%# DataBinder.Eval(Container.DataItem, "OutConId.PName")%>

                                            </CellTemplate>

   </igtbl:TemplatedColumn>

 

------------------设置跳转和下载模板列

 

    <CellTemplate>

                                <a href='<%# TranPath(DataBinder.Eval(Container.DataItem,"EleFile")) %>'>

                                    <%# TranName(DataBinder.Eval(Container.DataItem,"EleFile")) %></a>

    </CellTemplate>

 

-------------------修改需要绑定asp.net控件的话:通过这种方式获取设置值;

 

    Infragistics.WebUI.UltraWebGrid.TemplatedColumn tcum3 = (Infragistics.WebUI.UltraWebGrid.TemplatedColumn)this.UltraWebGrid1.Rows[i].Cells[5].Column;

                    Infragistics.WebUI.UltraWebGrid.CellItem citcum3 = (Infragistics.WebUI.UltraWebGrid.CellItem)tcum3.CellItems[i];

                    TextBox boxZRRQ3 = citcum3.FindControl("txtRestDateQ") as TextBox;

                    pbc.RestDateQ = boxZRRQ3.Text.Trim();

 

 

--------------------前台的一些js方法:

 

--------全选::::

  function SelectAll(colIndex)

    {

    var u2=document.getElementById("cbSelectAll");

    var checked=u2.checked;

    for (i = 0; i < oGrid.Rows.length; i++)

    {

       oGrid.Rows.getRow(i).getCell(colIndex).setValue(checked);

    }

    }

---------------函数:

  function validDJType()

    {

      var grid=igtbl_getGridById("UltraWebGrid2");

      var row=grid.getActiveRow();

      if(row==null)

      {

       alert("请选择要编辑的单据!");

       return false;

      }else

      {

            if(row.Band.Index!=0)

      {

       alert("请选择主数据行!");

        return false;

      }

      var washId= row.getCell(2).getValue();

       if(washId!=null&&washId!=0)

            {

             alert("冲账单不能编辑!");

             return false;

            }

             var ydrkdjxtbh= row.getCell(10).getValue();

       if(ydrkdjxtbh!=null&&ydrkdjxtbh!=0)

            {

             alert("预点完成的入库单不能编辑!");

             return false;

            }

      }

      return true;

    }

-----------------------------

  function validateDel()

    {

     var grid=igtbl_getGridById("UltraWebGrid2");

     var row=grid.getActiveRow();

     if(row!=null)

     {

           if(row.Band.Index!=0)

      {

       alert("请选择主数据行!");

        return false;

      }

         var ydrkdjxtbh= row.getCell(10).getValue();

       if(ydrkdjxtbh!=null&&ydrkdjxtbh!=0)

            {

             alert("预点完成的入库单不能删除!");

             return false;

            }else

            {

               if(confirm('确定删除?'))

               {

                 return true;

               }else

               {

                return false;

               }

           }

     }else

     {

       alert("请选择要删除的数据!");

       return false;

     }

    } 

---------------

    function goPage(event)

        {

             igtbl_pageGrid(event,'UltraWebGrid2',document.getElementById("PageNum").value);

        }    

----

 

-------------选择数据行案例:

 //选择id项;

    protected int GetRowsId()

    {

        if (UltraWebGrid1.DisplayLayout.SelectedCells[0] != null)

        {

            if (UltraWebGrid1.DisplayLayout.SelectedCells[0].Row != null)

            {

                return Convert.ToInt32(UltraWebGrid1.DisplayLayout.SelectedCells[0].Row.Cells[0].Text);

            }

            else

            {

                Messabox.ShowError(this, "请选择要操作的列");

            }

        }

        else

        {

            if (this.UltraWebGrid1.DisplayLayout.SelectedRows[0] != null)

            {

                return Convert.ToInt32(this.UltraWebGrid1.DisplayLayout.SelectedRows[0].Cells[0].Text.Trim());

            }

            else

            {

                Messabox.ShowError(this, "请选择要操作的列");

            }

        }

        return 0;

    }

第三方控件netadvantage UltraWebGrid总结


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论