Hello,
I'd like to ask how to work with unbound columns for gridcontrol (gridview control), for Win.v6.3 version.
I have dataset with tables, but I would like to display only some of table columns into gridview columns. I could not find any property, or example, how to do it (for v6.3 version).
Thanking in advance for any answer …
Regards,
Milovan
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Milovan,
The problem you're experiencing isn't quite clear to me. Our GridControl is designed in such a way that it is sufficient to assign a DataTable to it. After that, you will see columns and will be able to manage them. Unbound columns, in their turn, are used to display unbound data, i.e. data that doesn't exist in a bound data source. So, please clarify what you're talking about.
Thanks,
Ted
At first, I couldn't find property (for GridControl), similar to: AutoGenerateColumns (for 'classic' .NET dataGridView. If I set:
dataGridViewXY.AutoGenerateColumns to false, I could re-arange columns, set header text and order of display, etc).
Second, I couldn't find how to do data binding for particular columns in GridControl (similar code for 'classic' .NET dataGridView, say:
dataGridViewXY.Columns[index].DataPropertyName = myDataSource.Tables[index].Columns[index].ColumnName).
To be more clarify, I read data from SQL table (for some reason, I need all table data), but I'd like to display (in dataGridView) only a couple of columns. I know how to do it with .NET dataGridView, but don't know to do with GridControl …
I hope that my question is now clear …
Regards,
Milovan
Hi Milovan,
All this can be accomplished even using our GridControl version 6.3. To disable columns auto population, set the GridView's OptionsBehavior.AutoPopuplateColumns property to false. Next, you can open the designer and remove unnecessary columns. You can delete them or make them invisible by setting their Visible property to false. To assign a field name, use the column's FieldName property. You can do it either at design time or at runtime. Fill in the FieldName property with a string, containing the field name used in the data source. Please refer to the Overview of Columns and Card Fields help topic, to learn more.
Thanks,
Ted