Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
485
Template column RowAdding event - how do I get the value?
posted

I have a template column that is a label. When the rowadding event is fired I can get all the other fields that are bound except my template columns. The e.Values does not have it. I do not know how to get my value server side. Please help. 

I can do this on RowUpdating, but it does not work on RowAdding

drMedication("Medication_ID") = CType(e.Row.Items(3).FindControl("MedicationID"), Web.UI.WebControls.Label).Text '3

 

Parents
  • 49378
    posted

    Hi baileyjames,

    Thank you for posting in the community.

    When manually handling the row addition in WebDataGrid, the templated controls are not yet instantiated at the RowAdding stage (as opposed to the RowUpdating stage when the row object is fully accessible). After a row has been added to the datasource the InitializeRow event is fired again for each row. I suggest that you handle this event in order to access and modify your templated controls.

    Please let me know if this helps.

Reply Children