Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert text to a asp.net datagrid row

Status
Not open for further replies.

cmn2

Programmer
Mar 6, 2003
73
US
Hi,
Haven't had much luck in asp forum so I'll try here.
I've been struggling with this and could really use some help.
I have a datagrid with an edit command. When I open up a row in edit mode I would like to set some text in several text box columns, but only after a selection is made in a dropdownlist column. Thinking this could be done in javascript. Does anyone know how to do this? Thank you in advance for any help you can lend.
 
use the onchange event of the select box in javascript to manipulate values in the fields.

without some actual code we can only provide suggestions, not code help.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Your right, some code would help.
When dropdownlist onSelectedIndexChanged event fires, I would like to add Test123 to
the ProductDescription column while staying in edit mode.
I do not know how to do this in javascript and am looking for some assistance. Thanks



Here are my datagrid columns.

<asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" />

<asp:Buttoncolumn Text="Delete" CommandName="Delete"/>

<asp:BoundColumn HeaderText="id" SortExpression="id" ReadOnly="True" DataField="id" ItemStyle-Wrap="false"/>


<asp:TemplateColumn HeaderText="ProductDescription" SortExpression="ProductDescription">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ProductDescription") %>'/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" id="edit_ProductDescription" Text='<%# DataBinder.Eval(Container.DataItem, "ProductDescription") %>'/>
</EditItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="ProductID" SortExpression="ProductID">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ProductID") %>'/>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList runat="server" id="edit_ProductID" onSelectedIndexChanged="ProductIDChanged" AutoPostBack="true" Datasource="<%# arylstProductIDs %>"/>
</EditItemTemplate>
</asp:TemplateColumn>



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top