GridView
-
Hello, I have a grid view with one column and populated that with the following code, GridView1.DataSource = PropList; GridView1.DataBind(); Where PropList is a List of string . Now I have added another column in the GridView1 by the following code BoundField b; b = new BoundField(); b.HeaderText = "new1"; GridView1.Columns.Add(b); Now my problem is that if I have another list of string, How i Add that list to the new column. Please help me in this regards. Thanks sunil
-
Hello, I have a grid view with one column and populated that with the following code, GridView1.DataSource = PropList; GridView1.DataBind(); Where PropList is a List of string . Now I have added another column in the GridView1 by the following code BoundField b; b = new BoundField(); b.HeaderText = "new1"; GridView1.Columns.Add(b); Now my problem is that if I have another list of string, How i Add that list to the new column. Please help me in this regards. Thanks sunil
You cannot. You'd need a list of a struct which has two properties, as you can only bind to one source, but you can set the columns to pull data from properties of items in your list.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
You cannot. You'd need a list of a struct which has two properties, as you can only bind to one source, but you can set the columns to pull data from properties of items in your list.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Hi, Can you please give me sample code for this. Thanks, sunil