简体   繁体   中英

Telerik Radgrid Can we save a unique value against each column?

I am generating columns dynamically in my RadGrid, so column count and their names are generated on the fly and so is the datatable that the grid is to be bound to.
Each column either represents an object in my system, or an empty one for user to create a new object. Each object is identified by a unique value property.
I would like to set this value to the column, so, when the grid is edited, I would like to use this value and update the object. I am open for suggestions. For now I am thinking the options are

  • assigning the value to a property in GridTemplateColumn (which I dont think is possible)
  • use a hidden field in header of the column (how do I do it?)

To be more clear, both rows and columns are generated dynamically. I am using DataKeyNames for rows. Wondering how I should be storing unique values for columns!

Any help is appreciated.

Thanks!

I doubt if an official Telerik support exists here for this situation. One quirky solution will be to employ a row of hidden fields, one field per column, each storing unique value for the column.

You can add the unique value to one of the columns in the datatable and bind this column to grid. Make this column invisible so that it is not visible in the UI, but accessible in the backend.

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