Hi! I am migrating from 11.1 to 13.2 and I have a WebHierarchicalDataGrid that defines a javascript in the oninitializelayout event.
How do I define that event on the new grid?
I tried with OnInit but I get this error:
[mycontrol] does not contain a definition for '[myfunctionname]' and no extension method '[myfunctionname]' accepting a first argument of type '[mycontrol]' could be found (are you missing a using directive or an assembly reference?)
thank you!
Hello Nicole,
I am just following up to check if you have any further questions. If so, feel free to contact me again.
An alternative client-side event could be the initialize event:
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" … ClientEvents-Initialize="Initialize" >
…
</ig:WebHierarchicalDataGrid>
<script type="text/javascript">
function Initialize()
{
// your code here
}
</script>
A list with all available client-side events could be found at the Client-Events section of the WebHierarchicalDataGrid properties. I have added below for your reference how you could find them:
- In Design view right-click on the WebHierarchicalDataGrid widget.
- Choose properties.
- Scroll to the ClientEvents section
- Expand it
Hope this helps. If you have any additional questions regarding this don’t hesitate to contact me again.
Thank you.
But if you read my question correctly, I need this event to be handled by a JAVASCRIPT function, not a code-behind one.
Thank you for posting in our forum!
A possible alternative could be handling the InitializeBand event. This is how to implement it:
Client code:
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" Height="350px" Width="400px" OnInitializeBand="WebHierarchicalDataGrid1_InitializeBand" >
...
Code behind:
protected void WebHierarchicalDataGrid1_InitializeBand(object sender, Infragistics.Web.UI.GridControls.BandEventArgs e)
Please let me know if this approach fits your requirements.