J
Jc Morin
I all, my employer required me to add a bunch of control to a datagrid (such
as a drop down list on top corner to select page size and prev, bunch page
number adapted to current page, next and other button like export to excel).
All of those control do not required databinding (except of course the base
class Datagrid)
All of those control don't need view state (I will deal with current page
and stuff internaly)
We are already using the .NET datagrid with template so I create a control
that *derived* from the datagrid.
I feel some problem with
- Event from the dropdownlist
- Event from the button added
- Databinding to the base class (DataGrid)
I have only 2 of 3 working at the same time (any combinaison)!!!
If I have only dropdownlist and databinding it work, if I add a button in
the created child control.
I get some other stuff not working.
___
cmdBut = New LinkButton
cmdBut.Text = "Previous"
cmdBut.EnableViewState = False
AddHandler cmdBut.Click, AddressOf SomeActionButton_Click
Me.Controls.Add(cmdBut)
___
I don't need help about composite control that start from strach and add
their control, I need to keep DataGrid method and content working well.
Here is some questions in my head.
Should my control derived from a Datagrid or be composite and have a
Datagrid as member?
Do I have to implements IPostBackDataHandler? (for the dropdownlist maybe)
Do I have to implements IPostBackEventHandler? (for the button maybe)
Shoud I Controls.Clear() in the CreateChildControls() ? (droping my
Datagrid)
I have to overrides CreateControlHierarchy and PrepareControlHierarchy ?
I have to overrides Databind() ?
I would like to have a sample code or help about how to deal with this, else
I gonna copy paste the additive control all over my page
as a drop down list on top corner to select page size and prev, bunch page
number adapted to current page, next and other button like export to excel).
All of those control do not required databinding (except of course the base
class Datagrid)
All of those control don't need view state (I will deal with current page
and stuff internaly)
We are already using the .NET datagrid with template so I create a control
that *derived* from the datagrid.
I feel some problem with
- Event from the dropdownlist
- Event from the button added
- Databinding to the base class (DataGrid)
I have only 2 of 3 working at the same time (any combinaison)!!!
If I have only dropdownlist and databinding it work, if I add a button in
the created child control.
I get some other stuff not working.
___
cmdBut = New LinkButton
cmdBut.Text = "Previous"
cmdBut.EnableViewState = False
AddHandler cmdBut.Click, AddressOf SomeActionButton_Click
Me.Controls.Add(cmdBut)
___
I don't need help about composite control that start from strach and add
their control, I need to keep DataGrid method and content working well.
Here is some questions in my head.
Should my control derived from a Datagrid or be composite and have a
Datagrid as member?
Do I have to implements IPostBackDataHandler? (for the dropdownlist maybe)
Do I have to implements IPostBackEventHandler? (for the button maybe)
Shoud I Controls.Clear() in the CreateChildControls() ? (droping my
Datagrid)
I have to overrides CreateControlHierarchy and PrepareControlHierarchy ?
I have to overrides Databind() ?
I would like to have a sample code or help about how to deal with this, else
I gonna copy paste the additive control all over my page