How to display the corresponding information in the Gridview based on the value of the text of the d

Updated on technology 2024-02-10
13 answers
  1. Anonymous users2024-02-06

    When the value of the drop-down box changes, get the value of the drop-down box, then read the information you want based on that value, and then fill it in the gridview

    For example: private void combobox1 selectedindexchanged(object sender, eventargs e)= ;

  2. Anonymous users2024-02-05

    private void ddl_selectedindexchanged(object sender, eventargs e)

    Bind the gridview

    Note that you want to enable the outpostback attribute of DDL.

    If you want the page not to refresh, you can consider adding AJSX's updatepanel

  3. Anonymous users2024-02-04

    The principle of displaying the corresponding content in the drop-down box is to bind the data in the gridview after the dropdownlist so that the content of the drop-down box can be displayed, ** as follows:

    Foreground**: Backstage**.

    Handle gridview row bindings.

    /protected void gridview1_rowdatabound(object sender, gridviewroweventargs e)

    if ( ==

    Find the dropdownlist widget and bind or append the content.

    dropdownlist _callinidselcontrol = (dropdownlist)"callinidselcontrol");

    new listitem(text, value): Appends the form of content.

    listitem("First","1"));

    Bind the content form.

    = data source;

    _ = "Bind the text field";

    _ "Bind the value field";}}

  4. Anonymous users2024-02-03

    Pass the value of the drop-down box as a parameter to the query statement of the database, and you can query the data of the corresponding drop-down box.

  5. Anonymous users2024-02-02

    Now that you have queried the data from the database, you only need to pass the content of the query box to the background, go to the database to query the data with parameters again, and then display it on the page.

  6. Anonymous users2024-02-01

    Click Query and write an SQL statement based on the text box value as the condition, and write a query from the newly bound data source.

  7. Anonymous users2024-01-31

    load"vssql"] =“”;

    How to bind GridView: Public Void DataBindToGdv Order(String SQL).

    viewstate["vssql"] =sql;

    sql statement like this "select * from table where 1=1 "+sql+", then set the autopostback of the drop-down box to true, and write in its selectedIndexchanaged event, if (all) {

    Call the bind directly, if (replied).

    string sql="and reply content column is not null".

    databindtogdv_order(sql);}if (not replied).

    string sql="and reply content column is null"databindtogdv order(sql); It should be fine!!

  8. Anonymous users2024-01-30

    What do I do to get the ID of the text box? Like the textbox tb= upstairs"Textbox"as textbox, similar to the object of getting dropdownlist, object.; That's it.

  9. Anonymous users2024-01-29

    Are you going to query from the database through the contents of the drop-down list box and text box, and then display the query results in the gridview? This is the normal connection to the database, and then add the values of the drop-down list box and text box in the query condition.

  10. Anonymous users2024-01-28

    Here's a detailed description of the GridView; The solution to your problem can be found in [Column Fields of GridView Control], in fact, GridView controls can be inserted into drop-down list boxes and text boxes.

    You can also use TemplateField and CommandField to modify the information of the GridView in real time!

  11. Anonymous users2024-01-27

    For example, if you have a textbox with the name of textbox1 and a button with the name of button1, double-click the button to get the value of the text box in the click event of this button.

    string txtvalue=;

    Then modify your SQL statement.

    Original statement:"select * from product where productname='Green tea'“;

    Modified statement:"select * from product where productname='"+txtvalue+"'";

  12. Anonymous users2024-01-26

    Change sql sentence, if(parameter =="Green tea")

    else if(param=.)"Black tea")

  13. Anonymous users2024-01-25

    Extract the information from the drop-down box and make a judgment!

Related questions
20 answers2024-02-10

The drop-down box contains multiple items, and the text that can read one of the items in the drop-down box (n represents the index). >>>More