简体   繁体   中英

Non-invocable member “DevExpress.Xtragrid.Views.Base.ColumnView.Columns” cannot be used like a method?

I want to get TextEdit value to cell in GridView soI tried this code

gridView1.SetRowCellValue(GridControl.NewItemRowHandle, gridView1.Columns("forignkey"), textEdit12.Text);

Am getting error on Column is ""Non-invocable member cannot be used like a method"" How to solve the issue.

Columns is a collection (list), not a function. The indexer for collections/lists should be written with square brackets, not round brackets.

gridView1.Columns["forignkey"]

so the whole source should look like

gridView1.SetRowCellValue(GridControl.NewItemRowHandle, gridView1.Columns["forignkey"], textEdit12.Text);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM