We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

27996 Apr 21,2005 11:46 AM UTC Apr 21,2005 12:32 PM UTC WinForms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On April 21, 2005 11:46 AM UTC

Hi, I am using DataboundGrid. I added 10 columns using m_ListingTable.Columns.Add(new DataColumn("1")); I want to access same columns using GridBoundColumns How do i do that. It threw exception when i used the below code for (int start = 0; start < m_ListingTable.Columns.Count; start++) { GridBoundColumn column = new GridBoundColumn(); column.MappingName = m_ListingTable.Columns[0].ColumnName.ToString(); column.HeaderText = m_ListingTable.Columns[0].ColumnName.ToString(); if (!m_ListingGrid.GridBoundColumns.Contains(column)) { m_ListingGrid.GridBoundColumns.Add(column); } }

Administrator [Syncfusion]
Replied On April 21, 2005 12:32 PM UTC

Each of the DataColumns needs a different name, so you cannot create all ten using the name "1". In your loop, try using start instead of 0. column.MappingName = m_ListingTable.Columns[start].ColumnName.ToString(); column.HeaderText = m_ListingTable.Columns[start].ColumnName.ToString();

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;