Home Forums WPF controls Xceed DataGrid for WPF Iterating DataCells and Setting Name property

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24127 |

    After I bind a grid to a datatable, I have the need to have the name property of each cell to be set uniquely (I just want to label each one something like ” ‘Cell’ + ‘RowNum’ + ‘ColNum'”)
    This really because when a cell is clicked and becomes a text box, I want the text box to be named, AND I WOULD EXPECT?? that the text box inherits the name of it’s parent cell (tell me if not).

    I can’t figure out from the documentation how to iterate over each cell from the ExceedGrid object. I did a search and found some documentation for custom cell editors, but I can’t imagine it being this complicated.

    Thanks,

    Imported from legacy forums. Posted by ctek (had 424 views)

    User (Old forums)
    Member
    Post count: 23064

    I’m not sure I understand your need, there is no “automated” way to achieve this. Also consider that the cells that are not visually displayed on the screens are being virtualized (not really generated until needed). Your approach would no really work with our product.

    To iterate through the grids rows however, you will need to work with DataGridControl.Items collection.

    Imported from legacy forums. Posted by Matt (had 354 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks Matt.

    I appears the Items collection is read only, so there is no way to set the name attribute of a cell.

    Imported from legacy forums. Posted by ctek (had 293 views)

    User (Old forums)
    Member
    Post count: 23064

    It looks like I will have to use reflection to change the name property. Since I’ve never done something like this…..arghh…………….!!!!

    Imported from legacy forums. Posted by ctek (had 4038 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.