Click here to Skip to main content
15,894,540 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a datagrid with multiple columns, i want particular column as textbox, which populates dropdown selected value.i have used eval(), bind(). still not getting. any help in this regards?
(using bound column, dropdown value is populating in textbox,but using template column, its not populating)

What I have tried:

<asp:TemplateColumn HeaderText="Reporting TimeFrame" HeaderStyle-BorderColor="Black" ItemStyle-BorderColor="Black">
<itemtemplate>
<asp:TextBox ID="txtReportingTimeFrame" runat="server" Text='<%# Eval("ReportingTimeframe") %>'>
Posted
Updated 4-Apr-16 3:43am
v3
Comments
Richard Deeming 1-Apr-16 14:31pm    
Try replacing Eval with Bind:
Text='<%# Bind("ReportingTimeframe") %>'

If that doesn't solve the problem, then you'll need to explain what you mean by "not binding".
Member 12427485 4-Apr-16 5:46am    
Tried with Bind, still same issue. not even textbox is showing in datagrid, is it kind of javascript problem , because, i have excel button in my page, when i click that, textbox is showing without values.
Member 12427485 4-Apr-16 5:50am    
not binding - have to populate dropdown selected value in datagrid textbox column. textbox is not binding the dropdown value. (after deployment, it is showing just null value, when i click excel button, textbox is coming without values )
Richard Deeming 4-Apr-16 7:26am    
Click "Improve question" and update your question with the relevant parts of your code, and a proper description of the problem.
sreeyush sudhakaran 24-Apr-16 5:50am    
Cant to Update this in SelectedIndexChange Event of Drop down list after changing it's property to AutoPostBack=True?

Something like this dgv.rows[0].cells[1].Text = ddl.selectedValue;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900