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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add text to datagrid column when another column changes

Status
Not open for further replies.

cmn2

Programmer
Mar 6, 2003
73
0
0
US
Hello,
While in edit mode,I want to add some text to a textbox column in a datagrid when the selected text of a dropdownlist column changes. Thank you in advance to anyone who can help.

Here is the sub that is called from the dropdownlist...

Sub ProductIDChanged(sender As Object, e As EventArgs)
...when this sub fires, I would like to add Test123 to
the ProductDescription column while staying in edit mode.
end sub


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