Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7951175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:28:59+00:00 2026-06-04T02:28:59+00:00

I have an editable gridview with many columns. Two of which are 100mPlot and

  • 0

I have an editable gridview with many columns. Two of which are 100mPlot and SubPlot. SubPlot’s are not unique (1A, 1B, 1C, and 1D) but 100mPlot + SubPlot make a unique set of values.

When a user clicks “Edit”, they will see a dropdown list in the SubPlot column. This list needs to be based on what the value of 100mPlot is. So in order to display the correct values for SubPlot, I need to pass in a value from 100mPlot column as a parameter to the sqldatasource that would be bound to the SubPlot dropdownlist. How would I go about this?

<asp:BoundField DataField="100mPlot" HeaderText="100m plot" 
     SortExpression="100mPlot" ReadOnly="True" />
<asp:TemplateField HeaderText="SubPlot" SortExpression="SubPlot">
     <EditItemTemplate>
         <asp:DropDownList ID="DropDownList1" runat="server" 
             DataSourceID="dsSubPlotNames" 
             DataTextField="SiteID" DataValueField="SiteID" 
             SelectedValue='<%# Bind("SiteID") %>'
             AppendDataBoundItems="True">
             <asp:ListItem Value=""></asp:ListItem>
         </asp:DropDownList>
         <asp:SqlDataSource ID="dsSubPlotNames" runat="server" 
             ConnectionString="<%$ ConnectionStrings:WERCMTX %>" SelectCommand="exec [339_PPM].usp_SubPlotNames_Select @100mPlotSiteID;">
             <SelectParameters>
                 <asp:Parameter Name="100mPlotSiteID" />
             </SelectParameters>
          </asp:SqlDataSource>
       </EditItemTemplate>
       <ItemTemplate>
           <asp:Label ID="Label3" runat="server" Text='<%# Bind("SubPlot")%>'></asp:Label>
       </ItemTemplate>
</asp:TemplateField>

As you can see, the parameter name “100mPlotSiteID” needs to be taken from 100mPlot column. I’m not sure how else to describe this anymore clearly, let me know if you have any questions. Thanks for your help.

EDIT with newly revised code. So close now!

<asp:TemplateField HeaderText="SubPlot" SortExpression="SubPlot">
    <EditItemTemplate>                            
        <asp:DropDownList ID="DropDownList1" runat="server" 
            DataSourceID="dsSubPlotNames" 
            DataTextField="SiteName" DataValueField="SiteID" 
            SelectedValue='<%# Bind("SiteID") %>'
        >
        </asp:DropDownList>
        <asp:SqlDataSource ID="dsSubPlotNames" runat="server" 
            ConnectionString="<%$ ConnectionStrings:WERCMTX %>" SelectCommand='exec [339_PPM].usp_SubPlotNames_Select null, @100mPlotName;'
            CancelSelectOnNullParameter="False">                                
            <SelectParameters>
                <asp:ControlParameter ControlID="GridView1" DefaultValue='<%# Eval("100mPlot") '
                    Name="100mPlotName" PropertyName="SelectedValue" />
             </SelectParameters>
         </asp:SqlDataSource>
     </EditItemTemplate>
          <ItemTemplate>
              <asp:Label ID="Label3" runat="server" Text='<%# Bind("SubPlot") %>'></asp:Label>
     </ItemTemplate>                        
 </asp:TemplateField>

Unfortunately, I get this error with the Eval(“100mPlot”):

Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.ControlParameter does not have a DataBinding event.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:29:01+00:00Added an answer on June 4, 2026 at 2:29 am

    You need to put a label and set the text property to '<%# Eval("100mPlot") %>' and use a control paremeter in dthe datasource.

    If the label’s id is “label1” (must be inside edit item template) then use this

    <asp:ControlParameter ControlID="label1" PropertyName="Text" Name="100mPlotSiteID" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my JTable, I have two editable numeric columns. The editor for both columns
Well, I have GridView with editable field like 'TemplateField' with DropDownList. My code: <Columns>
I'm using an Telerik RadGridView in a WPF application, which has two editable columns
I have an editable JComboBox which contains a list of single letter values. Because
I have a gridview with row selection which should set the page's elements value
I have an ASP.Net GridView, with two columns (ID and name). The name column
I have a simple table view which is editable. All I need the user
I have a treeview with an editable CellRendererText: self.renderer = gtk.CellRendererText() self.renderer.set_property('editable', True) But
I have a listview with lists lines of an invoice (Which are editable), each
I have telerik grid on my page. But it working not correctly. Problem: when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.