When using the radgrid control. If you encounter the dropdownlist control, we cannot
Set selectindex directly in HTML code
Maybe we want to set the page as a preliminary control.
If (! Page. ispostback)
{
Bindcontrol (); // bind the control here
}
But we will find that. This page. ispostback is the same when loading and sending back, and does not get the loading status callback.
At this time, we can use oninit to implement it.
Protected override void oninit (eventargs E)
{
This. databinding + = new eventhandler (beheer_usercontrols_tickertapeeditor_databinding );
Base. oninit (E );
}
Void beheer_usercontrols_tickertapeeditor_databinding (Object sender, eventargs E)
{
Object target = databinder. eval (dataitem, "strhtmltarget ");
If (target = NULL | target is dbnull)
{
Ddltarget. selectedindex = 0;
}
Else
{
Ddltarget. selectedvalue = (string) target;
}
}
It is unclear whether the grid provided by Asp.net is similar.