c# - Pass values from TextBox to Telerik RadGrid -


is possible fill column radgrid using value enter textbox?

this textbox values from

<asp:textbox id="txtaddnum" textmode="number" width="30px" runat="server" min="1" maxlength="100" step="1" autopostback="true"></asp:textbox> 

and radgrid, column i'll add values "commitment"

 <telerik:radgrid id="grdaddgoals" allowpaging="true" allowsorting="true" pagesize="8"                                 runat="server" autogeneratecolumns="false" showstatusbar="true" enablelinqexpressions="false"                                 gridlines="none" cellpadding="0" headerstyle-height="30" cellspacing="0" enableembeddedbasestylesheet="false"                                 enableembeddedskins="false" skin="basicblue" allowfilteringbycolumn="false" onprerender="grdaddgoals_prerender"                                 onitemcreated="grdaddgoals_itemcreated">                                 <mastertableview enablenorecordstemplate="true">                                     <norecordstemplate>                                         <asp:label id="lblnomessage" runat="server" forecolor="red" text="no goals detail found"></asp:label>                                     </norecordstemplate>                                     <columns>                                         <telerik:gridtemplatecolumn headertext="" allowfiltering="false" headerstyle-width="30px">                                             <itemtemplate>                                                 <span style="background: url('app_themes/basicblue/images/arrow_table.png') no-repeat scroll center center transparent;                                                     width: 30px; margin-top: 5px;">&nbsp;&nbsp;&nbsp;</span>                                             </itemtemplate>                                         </telerik:gridtemplatecolumn>                                 <telerik:gridtemplatecolumn uniquename="commitment" headertext="commitment" allowfiltering="false" headerstyle-width="100px">                                 <itemtemplate>                                 <asp:textbox id="txtcommitment" runat="server"  width="109px"></asp:textbox>                                 </itemtemplate>                                  </telerik:gridtemplatecolumn>                                  <telerik:gridboundcolumn uniquename="goalnumber" datafield="goalnumber" headertext="goal" itemstyle-horizontalalign="center"                                     allowfiltering="false" headerstyle-width="50px" showsorticon="true" sortascimageurl="app_themes/basicblue/images/sortorderasc_arrow.png"                                     sortdescimageurl="app_themes/basicblue/images/sortorderdesc_arrow.png">                                 </telerik:gridboundcolumn>                                       </columns>                                 </mastertableview>                                 <clientsettings enablepostbackonrowclick="true">                                     <selecting allowrowselect="true" />                                     <scrolling allowscroll="true" usestaticheaders="true" frozencolumnscount="2" scrollheight="200px"                                         savescrollposition="true" />                                 </clientsettings>                             </telerik:radgrid> 

i have tried no luck

what understand when enter text in "txtaddnum" textbox want show same text in (all) 'txtcommitment' textboxs. let me know if incorrect.

please try below code snippet.

aspx.cs

protected void txtaddnum_textchanged(object sender, eventargs e) {     foreach (griddataitem dataitem in grdaddgoals.mastertableview.items)     {         textbox txtquantity = (textbox)dataitem.findcontrol("txtcommitment");         txtquantity.text = txtaddnum.text;     } } 

aspx

<asp:textbox id="txtaddnum" textmode="number" width="30px" runat="server" min="1" maxlength="100" step="1"             autopostback="true" ontextchanged="txtaddnum_textchanged"></asp:textbox> 

let me know if concern.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -