Skip to content

Gridview Datasource Query

Richie Cutler

Asked Mar 28, 2012, 2:44 AM EDT2 answers
Share
LinkedInX
Hi all
ok I have a gridview that gets its datasource from a class using subsonic method RetrieveAllActive()

The gridview displayed now depends on a selection in a drop down list generated dynamically.

The datasource calls used to look like this

if (drp_Tables.SelectedValue == "Asset")
{
 gv_Display_The_Data.DataSource = Asset.RetrieveAllActive();
}
if (drp_Tables.SelectedValue == "AssetType")
{
 gv_Display_The_Data.DataSource = AssetType.RetrieveAllActive();
}

I now need to call the datasource using the selected value in drp_Tables something like this

gv_Display_The_Data.DataSource = drp_Tables.SelectedValue.RetrieveAllActive();

Is there anyway to do this ? how do I set the namespace to be called to the value stored in drp_Tables.SelectedValue.

Any help would be appreciated

Richie

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Senthilkumar
    0
    Hi,

    It will now allow you to use the value of the drop down instead of class name.

    It will consider like string.
    0
  • 0
    Hi

    It wont allow the call because drp_Tables_SelectedValue doesnt have a method called RetrieveAllActive().
    I need to know how to set the data inside drp_Tables.SelectedValue as a recognised classname
    0