locked
how to call oninit while creating object RRS feed

  • Question

  • User726682967 posted

    i created one user control for gridview, in that i added pagesize(dropdownlist),page index(dropdownlist),next and previous links. in oninit event create objects for all controls and added events it's working fine when i use this as control other than this if crate object for customgrid then oninit event not fired please tell me which event is suitable for creating objects of controls and added events to that controls.

    my code like below

    public class CustomPager : GridView
    {

    protected override void OnInit(EventArgs e)
    {

    for (int i = 10; i <= 100; i += 10)
    {
    ddlNumberOfPages.Items.Add(i.ToString());
    ddlFooterNumberOfPages.Items.Add(i.ToString());
    }

    }

    }

    Wednesday, November 25, 2015 6:57 AM

All replies