DataReapeterItem e pulsanti

0
0

Ciao

1 – If I insert a button (such as deleting records) into a DataReapeterItem (Example attached) how do I capture the item ID?
2 – Is it possible to hide or disable buttons based on some values in other fields?

 

Grazie

Alessandro

Attachment
  • You must to post comments
0
0

You could listen to the CurrentItemIndexChanged event.
To know the previous item you can save CurrentItemIndex property in a local variable.

Best regards
Frank

  • You must to post comments
0
0

Ciao,

When I click on a datarepeaterItem I make one or more buttons visible. How do I hide them when I switch from one datarepeaterItem to another? (i.e. in datarepeaterItems that lose focus?)

Grazie

Alessandro

  • You must to post comments
0
0

Ciao,

please find a sample attached that shows how to use the Button Tag to bind to an ID
and how to handle child controls inside ItemUpdate.

Best regards
Frank

  • You must to post comments
0
0

As for the first question I tried to make the bind button Tag property:
Button1.DataBindings.Add(“Tags”, dataView, “nominative”)

But using the following Sub gives me an empty message

Private Sub Button1_Click(sender As Object, and As EventArgs) Handles Button1.Click
    MsgBox(Button1.Text)
End Sub
Am I wrong?

Grazie

  • You must to post comments
0
0

Ciao,

  1. If your DataRepeater is data bound you can simple bind your button Tag property to your item ID.
    If not, you can assign the button tag when filling the DataRepeater
  2. You can handle the ItemUpdate event. Here your get the item in e.Item.
    Use FindControl to identify your child controls and then you can show/hide based on any condition.

Best regards
Frank

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.