ValentinBadea Posted April 20, 2005 Posted April 20, 2005 Hello ! 2 questions: 1) I have a datagrid with a button column and this code for getting info from a row Private Sub MyDataGrid_ItemCommand(ByVal source As Object, _ ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) _ Handles MyDataGrid.ItemCommand Label1.Text = e.Item.Cells(2).Text() End Sub If Button Column is a LinkButton - > OK If Button Column is a PushButton - > this sub is not accessed (debug stop not stopped). What is wrong ? 2) How can be implemented a column in a datagrid with PushButtons on it and different captions for this buttons (for each row another caption on his button) ? Quote
ValentinBadea Posted April 20, 2005 Author Posted April 20, 2005 Resolved ! I missed to add this on Page_Load [b]If Not Page.IsPostBack Then[/b] MyDataGrid.Databind() [b]end if[/b] so button click event don't fired becouse rebinding of the DataGrid flushes out the ItemCommand event Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.