P
Paul Reilly
Hi,
I've created a datagrid that has edititemtemplates. One of the
edititemtemplate columns is actually two listboxes that are bound from
sql calls when the edit button is clicked - they represent a
"container" structure, where you can move elements from one side to
the other. I do not know of any server side .net "container" options
so I am implementing it client side javascript. I've done it before
and it's fairly straight forward - you have buttons that just call
javascript functions passing in the select box's name's (id's).
The problem I am having is that when I have these listboxes within the
datagrid, their names are changed in the compiled output. This is a
simplified version of the edititemtemplate in question:
<EditItemTemplate>
<asp:ListBox RUNAT="server" id="available"
DataValueField="name"
DataTextField="name"
MULTIPLE
DataSource=<%# FillLeft((int)DataBinder.Eval(Container.DataItem,"id"))%>
/>
<INPUT TYPE="BUTTON" VALUE=">>"
onClick="setAll('compareForm','available',true);
transfer('compareForm','available','compareto',35)"><BR>
<asp:ListBox RUNAT="server"
id="compareto"
DataValueField="name"
DataTextField="name" MULTIPLE
DataSource=<%# FillRight((int)DataBinder.Eval(Container.DataItem,"id"))%>
/>
</EditItemTemplate>
This column resides within the "resultsDataGrid" dataGrid.
If you notice the input box in the middle, it calls javascript
functions that pass the listbox name as parameters. However when I
view this page in a browser, the name of the available select box is
not "available" it is something dynamic such as
"resultsDataGrid:_ct12:available". How can I pass the real select name
to my javascript functions considering .net is setting it dynamically.
Thanks for the help!
Paul
I've created a datagrid that has edititemtemplates. One of the
edititemtemplate columns is actually two listboxes that are bound from
sql calls when the edit button is clicked - they represent a
"container" structure, where you can move elements from one side to
the other. I do not know of any server side .net "container" options
so I am implementing it client side javascript. I've done it before
and it's fairly straight forward - you have buttons that just call
javascript functions passing in the select box's name's (id's).
The problem I am having is that when I have these listboxes within the
datagrid, their names are changed in the compiled output. This is a
simplified version of the edititemtemplate in question:
<EditItemTemplate>
<asp:ListBox RUNAT="server" id="available"
DataValueField="name"
DataTextField="name"
MULTIPLE
DataSource=<%# FillLeft((int)DataBinder.Eval(Container.DataItem,"id"))%>
/>
<INPUT TYPE="BUTTON" VALUE=">>"
onClick="setAll('compareForm','available',true);
transfer('compareForm','available','compareto',35)"><BR>
<asp:ListBox RUNAT="server"
id="compareto"
DataValueField="name"
DataTextField="name" MULTIPLE
DataSource=<%# FillRight((int)DataBinder.Eval(Container.DataItem,"id"))%>
/>
</EditItemTemplate>
This column resides within the "resultsDataGrid" dataGrid.
If you notice the input box in the middle, it calls javascript
functions that pass the listbox name as parameters. However when I
view this page in a browser, the name of the available select box is
not "available" it is something dynamic such as
"resultsDataGrid:_ct12:available". How can I pass the real select name
to my javascript functions considering .net is setting it dynamically.
Thanks for the help!
Paul