gpt4 book ai didi

dropdownlist unable to find in rowupdating event(在行更新事件中找不到下拉列表)

转载 作者:bug小助手 更新时间:2023-10-24 19:27:30 31 4
gpt4 key购买 nike



I use TemplateField to create dropdownlist in 2nd column when in edit mode. but it cannot be find cell(1).control(0) when in RowUpdating event, only the cell(0) TextBox can be find. It shows the argument out of range exception. Anyone also face the same issue?

在编辑模式下,我使用Templatefield在第二列中创建下拉列表。但在RowUpdating事件中,只能找到单元格(0)文本框时,它不能是Find cell(1).control(0)。它显示参数超出范围异常。有没有人也面临同样的问题?


TemplateColumn = New TemplateField
TemplateColumn.ShowHeader = True
TemplateHeaderTxt = dicColumnMap(gDataTable.Columns.Item(i).Caption)
TemplateDataField = gDataTable.Columns.Item(i).Caption
TemplateColumn.HeaderTemplate = New GridViewTemplate(DataControlRowType.Header, TemplateHeaderTxt, "", "")
TemplateColumn.ItemTemplate = New GridViewTemplate(DataControlRowType.DataRow, TemplateDataField, TemplateDataField, "Label")
TemplateColumn.EditItemTemplate = New GridViewTemplate(DataControlRowType.DataRow, TemplateDataField, TemplateDataField, "DropDowmList", sqlConn)

Account_GridView.DataSource = gDataTable
Account_GridView.DataBind()


Private Sub Account_GridView_RowUpdating(sender As Object, e As GridViewUpdateEventArgs) Handles Account_GridView.RowUpdating
Dim row = Account_GridView.Rows(e.RowIndex)

Dim accountdate, payflow, member, typename, subtype, price, exchangeRate, comment, groupname, ID As String

Dim cnt = row.Cells.Count

accountdate = CType(row.Cells(0).Controls(0), TextBox).Text
payflow = CType(row.Cells(1).Controls(0), DropDownList).SelectedItem.Value
End Sub


I tried row.Cells(1).HasControls, but it shows false, it is obvious no object in 2nd column, it is so weird

我尝试了row.Cells(1).HasControls,但它显示为假,显然在第二列中没有对象,太奇怪了


更多回答
优秀答案推荐
更多回答

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com