Telerik 访问 RadGrid 中的文本框列

发布于 2024-07-11 14:30:27 字数 124 浏览 7 评论 0原文

您是否知道如何访问添加到 radgrid 的文本框,这些文本框未绑定,但用于捕获用户在该列的文本框中键入的任何与行相关的输入。 当发生回发时,我需要访问此数据服务器端。 非常感谢您的想法 谢谢你

托尼

Do you know how to access textboxes added to a radgrid that are not bound but are used to trap any row related input a user typed in to the textbox for that column.
I need to access this data server side when a postback occurs.
Your thoughts are greatly appreciated
Thanking you

Tony

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

等你爱我 2024-07-18 14:30:27

这取决于如何添加/创建这些文本框。 如果“未绑定”意味着它们位于模板列中,您应该能够在网格事件之一中使用 .FindControl 来获取该文本框。
同样,哪个事件将取决于导致回发发生的原因。
出于此代码示例的目的,我假设您正在处理网格上的命令项

Private Sub radGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles RadGrid1.ItemCommand
  Select Case e.CommandName
    Case "Update"
      Dim txt as Textbox
      txt = e.Item.FindControl("textboxID")
      If Not txt is Nothing Then someObject.someString = txt.Text

    Case Else
      'do something else

End Sub

希望有所帮助。

That depends on how those textboxes are being added/created. If by 'not bound' you mean they are in Template columns you should be able to use .FindControl in one of the grid's events to grab that textbox.
And again which event will depend on what is causing the postback to happen.
For the purpose of this code example I'll assume you are dealing with a Command item on the grid

Private Sub radGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles RadGrid1.ItemCommand
  Select Case e.CommandName
    Case "Update"
      Dim txt as Textbox
      txt = e.Item.FindControl("textboxID")
      If Not txt is Nothing Then someObject.someString = txt.Text

    Case Else
      'do something else

End Sub

Hope that helps.

时光瘦了 2024-07-18 14:30:27
Private Sub radGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles RadGrid1.ItemCommand
  Select Case e.CommandName
    Case "Update"
      Dim txt as Textbox
      txt = e.Item.FindControl("textboxID")
      If Not txt is Nothing Then someObject.someString = txt.Text

    Case Else
      'do something else

End Sub
Private Sub radGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles RadGrid1.ItemCommand
  Select Case e.CommandName
    Case "Update"
      Dim txt as Textbox
      txt = e.Item.FindControl("textboxID")
      If Not txt is Nothing Then someObject.someString = txt.Text

    Case Else
      'do something else

End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文