Click here to Skip to main content
14,244,088 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,
how to add textbox column, calender column and combobox column dynamically in C# code for listview/datagri.

please help me.

Thanks
Vinaya
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Create column objects, set their properties appropriately, and add the columns to the grid's columns collection. Just regular C#....

Example:

DataGridTextColumn textcol = new DataGridTextColumn(); 
textcol.Header = "Column Header"; 
textcol.Binding = new Binding("MyColumnProperty"); 
dataGrid.Columns.Add(textcol); 
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100