bring the columns dynamically according to search

bring the columns dynamically according to search

ProgamProgam Posts: 5Questions: 0Answers: 0
edited June 2013 in General
Colleagues, I use this code and can not bring the columns only when I leave the pre-defined, but if I wanted to use the same gridview, and searching of different tables with different number of columns, and dynamically populate, as the gridview does not natively integration with the jquery plugin datables.

[code]









<%# Eval("id") %>





<%# Eval("engine")%>





<%# Eval("browser")%>





<%# Eval("platform")%>





<%# Eval("version")%>





<%# Eval("grade")%>

<%--

--%>




<%# Eval("marketshare")%>





<%# Eval("RDate")%>





<%--



Total:








S.No


Rendering Engine


Browser


PlotForm


Engine Version


CSS Grade


Market Share


Release Date



--%>






[/code]
========================

How to do this with datables dynamically?

Replies

  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    I am sorry, but I have no clue what you mean :)
  • ProgamProgam Posts: 5Questions: 0Answers: 0
    Ok friend, i will explain. For example, if a i have 2 tables in my database mysql one call user, and another car, in the table user i have the colums:

    name, tel, age, adress

    in the table car have the colums:

    carname, model

    So, in one talbe exist 4 colums and another have 2 two, one different from another.
    If i use just the gridview, and a
    ....
    this.GridView1.DataSource = ds;
    this.DataBind();

    and in a search i choose to search user, the gridview will be apper with 4 colums, but if i choose the car, the grid will appear with 2 columns, i no need to set the columns of gridview the example of above post:



    <%# Eval("id") %>


    ...
    ...

    So, the gridview will bring the columns dynamically, do you understand now? (sorry for my bad english grammar).

    Cheers
This discussion has been closed.