Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GridView events inside a repeater?

Status
Not open for further replies.

elhaix

Programmer
Jul 31, 2006
115
CA
So the last problem I had, where I was trying to reference the gridview contained within the repeater has been solved - that was, trying to access grid properties in a grid event delegate - ie. Grid_RowDataBound.

Dim thisUserID = CType(sender, GridView).DataKeys(e.Row.DataItemIndex).Item("EmployeeUserID")

Was the answer - referencing the sender grid, instead of the grid itself.



On the same note, I am unable to get the each grid's Update and CancelEdit events to fire.



For my test case, I have a repeater with displays two grids (based on data). Grid 1 has two rows, Grid 2 has one row.

When edit a row in Grid 1, and hit either cancel or save - none of the methods fire. Another side effect is that a calculated cell which is done in the Grid_RowDataBound goes blank in the other grid (same holds true for Grid 2). I'm sure I can get around this latter problem by doing a .DataBind when the time is right, but that would be at the end of the Cancel or Update delegates, right, and so far, I'm unable to fire any of them.

So in short - unable to execute Update/CancelEdit events for each row of my GridView contained in a repeater.

Any assistance would be greatly appreciated.

Thank you.


 
Ok..

This might not be the complete answer you want, but I have just finished building a page that dynamily loaded textbox's based on rows and cols in an xml file.

Each of these controls needed to be able to fire an event on the change event. To do this I declared a that was a textbox. Each box was then dynamicly bound to an event proceedure that matched the signature for a textbox. Using the "addHandler" method.

e.g. AddHandler t.TextChanged, AddressOf TextBox1_TextChanged


Any chance you could bind your grids after they have been created in the page_load event?


Rob

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top