ItemCommand not firing on first click in Repeater or GridView

前端 未结 3 734
无人及你
无人及你 2021-01-22 13:37

This has been driving me crazy for 2 days now - hope someone has seen this before.

I have this issue where the first click of a control within a repeater or grid view fa

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-22 14:06

    I figured it out, but I don't understand why.
    The original code was:

    Me.rpAgreementContractors.DataSource = dtContractors
    Me.rpAgreementContractors.DataBind()
    Me.tblAgreementContractors.Visible = True
    Me.phDataPane.Controls.Add(Me.tblAgreementContractors)
    

    I changed it to make the table visible and add it to the placeholder before I set the datasource and bound it. Problem solved.

    Me.tblAgreementContractors.Visible = True
    Me.phDataPane.Controls.Add(Me.tblAgreementContractors)
    Me.rpAgreementContractors.DataSource = dtContractors
    Me.rpAgreementContractors.DataBind()
    

提交回复
热议问题