页面上做了一个可编辑的GRID,里边新增行后要选择配件,需要带过来 编码、名称、单价、仓库编码、仓库名称,在选择配件的那个页面是可以跟踪到已经获取到选择的记录的内容的,但是就是没法全部传到新增的行里,只能带过来一个值,帮忙看看为什么,谢谢。
<Rows>
<x:FormRow ID="FormRow4" runat="server">
<Items>
<x:TabStrip ID="TabStrip1" Height="300px" AutoPostBack="true" ShowBorder="true" ActiveTabIndex="0" runat="server">
<Tabs>
<x:Tab ID="Tab1" Title="配件信息" EnableBackgroundColor="true" BodyPadding="5px"
Layout="Fit" runat="server">
<Items>
<x:Grid ID="Grid1" runat="server" BoxFlex="1" ShowBorder="true" ShowHeader="false" EnableRowSelect="true"
EnableCheckBoxSelect="true" EnableRowNumber="true" EnableRowNumberPaging="true"
DataKeyNames="Id,Name,InvId,WareHouseID,WareWouseName,InvPrice" AllowSorting="false" SortColumnIndex="0"
SortDirection="DESC" AllowPaging="true" AllowCellEditing="true" IsDatabasePaging="true"
EnableHeaderMenu="false">
<Toolbars>
<x:Toolbar ID="Toolbar2" runat="server">
<Items>
<x:Button ID="btnNew" Text="新增数据" Icon="Add" EnablePostBack="false" runat="server">
</x:Button>
<x:Button ID="btnDelete" Text="删除选中行" Icon="Delete" EnablePostBack="false" runat="server">
</x:Button>
<x:ToolbarFill ID="ToolbarFill1" runat="server">
</x:ToolbarFill>
</Items>
</x:Toolbar>
</Toolbars>
<ageItems>
<x:ToolbarSeparator ID="ToolbarSeparator4" runat="server">
</x:ToolbarSeparator>
<x:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</x:ToolbarText>
<xropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<xistItem Text="10" Value="10" />
<xistItem Text="20" Value="20" />
<xistItem Text="50" Value="50" />
<xistItem Text="100" Value="100" />
</xropDownList>
</PageItems>
<Columns>
<%--<x:TemplateField ColumnID="Number" Width="60px">
<ItemTemplate>
<aspabel ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></aspabel>
</ItemTemplate>
</x:TemplateField>--%>
<x:RenderField Width="150px" ColumnID="Name" DataField="Name" FieldType="String"
HeaderText="配件名称">
<Editor>
<x:TriggerBox ID="tbSelectedRole" EnableEdit="false" EnablePostBack="false" TriggerIcon="Search"
runat="server">
</x:TriggerBox>
</Editor>
</x:RenderField>
<x:RenderField Width="150px" ColumnID="InvId" DataField="InvId" FieldType="String"
HeaderText="配件编码">
<Editor>
<x:TextBox ID="TextBox3" Required="true" Readonly="false" runat="server">
</x:TextBox>
</Editor>
</x:RenderField>
<x:RenderField Width="150px" ColumnID="WareHouseID" DataField="WareHouseID" FieldType="String"
HeaderText="仓库编码">
<Editor>
<x:TextBox ID="tbxEditorName" Required="true" runat="server">
</x:TextBox>
</Editor>
</x:RenderField>
<x:RenderField Width="150px" ColumnID="WareWouseName" DataField="WareWouseName" FieldType="String"
HeaderText="仓库名称">
<Editor>
<x:TextBox ID="TextBox2" Required="true" runat="server">
</x:TextBox>
</Editor>
</x:RenderField>
<x:RenderField Width="100px" ColumnID="InvPrice" DataField="InvPrice" FieldType="String"
HeaderText="单价">
<Editor>
<x:TextBox ID="TextBox1" Required="true" runat="server">
</x:TextBox>
</Editor>
</x:RenderField>
<x:RenderField Width="100px" ColumnID="EntranceYear" DataField="EntranceYear" FieldType="Int"
HeaderText="数量">
<Editor>
<x:NumberBox ID="tbxEditorEntranceYear" NoDecimal="true" NoNegative="true" MinValue="1"
runat="server">
</x:NumberBox>
</Editor>
</x:RenderField>
</Columns>
</x:Grid>
</Items>
</x:Tab>
</Tabs>
</x:TabStrip>
</Items>
</x:FormRow>
</Rows>
private void InitInv()
{
//throw new NotImplementedException();
string selectDeptURL = String.Format("./BY_Sel_Inv.aspx?ids=<script>{0}</script>", HiddenField1.GetValueReference());
tbSelectedRole.OnClientTriggerClick = Window1.GetSaveStateReference( TextBox3.ClientID,tbSelectedRole.ClientID, TextBox1.ClientID, tbxEditorName.ClientID, TextBox2.ClientID, HiddenField1.ClientID)
+ Window1.GetShowReference(selectDeptURL, "选择配件档案");
}
-------------选择后返回---------------------------------------------------
protected void btnSaveClose_Click(object sender, EventArgs e)
{
int selectedRowIndex = Grid1.SelectedRowIndex;
string deptId = Grid1.DataKeys[selectedRowIndex][1].ToString();
string deptName = Grid1.DataKeys[selectedRowIndex][2].ToString();
string iprice = Grid1.DataKeys[selectedRowIndex][5].ToString();
string whid = Grid1.DataKeys[selectedRowIndex][3].ToString();
string whname = Grid1.DataKeys[selectedRowIndex][4].ToString();
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(deptId, deptName, iprice, whid, whname)
+ ActiveWindow.GetHideReference());
}
|