K
Kelmen Wong
Greeting,
I'm working on a routine that dynamically locate a html/web control
using FindControl(), then perform some manipulation like bind a
datatable onto the control.DataSource.
switch(objCtrl.GetType().Name)
{
case "HtmlSelect":
HtmlSelect objHtmlSelect = (HtmlSelect)objCtrl;
if(drowBlankVal != null)
{
drowBlankVal[objHtmlSelect.DataValueField] = "";
drowBlankVal[objHtmlSelect.DataTextField] = strBlankValTxt;
dtblList.Rows.InsertAt(drowBlankVal, 0);
}
objHtmlSelect.DataSource = dtblList;
objHtmlSelect.DataBind();
objHtmlSelect = null;
break;
I wanna write a function to do the binding, problem is the control
class is dynamic, and I can't and unsuccessful to typecast them to any
generic/base control that have the property DataSource and DataBind().
Anyone got any better way for this one?
I'm working on a routine that dynamically locate a html/web control
using FindControl(), then perform some manipulation like bind a
datatable onto the control.DataSource.
switch(objCtrl.GetType().Name)
{
case "HtmlSelect":
HtmlSelect objHtmlSelect = (HtmlSelect)objCtrl;
if(drowBlankVal != null)
{
drowBlankVal[objHtmlSelect.DataValueField] = "";
drowBlankVal[objHtmlSelect.DataTextField] = strBlankValTxt;
dtblList.Rows.InsertAt(drowBlankVal, 0);
}
objHtmlSelect.DataSource = dtblList;
objHtmlSelect.DataBind();
objHtmlSelect = null;
break;
I wanna write a function to do the binding, problem is the control
class is dynamic, and I can't and unsuccessful to typecast them to any
generic/base control that have the property DataSource and DataBind().
Anyone got any better way for this one?