0
Reply

OnItemCommand problem

osman_hashmi

osman_hashmi

Jan 30 2004 7:19 PM
1.7k
Hi Main Problem The problem is when I click on the button it does not go to the Item_Command function which is called by OnItemCommand it just refreshes the page and all the buttons vanish. I think it might be to do with the type of button in the datagrid, it is dynamically generated in the C# code. Problem 2 In the function Item_Command which is called by OnItemCommand when the button is clicked, how do I find out which column the cell is in and also the "pas_no" (primary key of the row of data) of the row the cell is in. //This function is supposed to be called by the OnItemCommand void Item_Command(Object sender, DataGridCommandEventArgs e) { //Code } //This function is called by the OnItemBound and generates a button if the data cell is empty void UpdateImage(Object sender, DataGridItemEventArgs e) { if((e.Item.ItemType != ListItemType.Header)) { Button butReceive = new Button(); butReceive.Text="Update"; if (e.Item.Cells[4].Text =="") { e.Item.Cells[4].Controls.Add(butReceive); } } <%# DataBinder.Eval(Container.DataItem, "ts_received") %> Please can you help Oz ps If I have not explained it properly please ask