Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Ismail Mayat 4036 posts 8300 karma points MVP admin c-trib
    Aug 10, 2015 @ 15:18
    Ismail Mayat

    Datatype grid null cell test

    How do i test if cell exists in datatype grid? I have

    if (row.GetCell("clickEventJs")!= null)

    Where row is GridRow

    However this gives key not found exception. I have also tried


    Same error.

    Any ideas?



  • Warren Buckley 2063 posts 4418 karma points MVP 6x admin hq c-trib
    Aug 10, 2015 @ 15:57
    Warren Buckley

    I believe the row object has a list/collection of cell objects in it.

    With that being the case try a lambda expression to test if the current row has a cell with the alias of clickEventJs.

    This is totally off the top of my head

    @foreach(var row in Model.MyDataTypeGridAlias){
        //Check that our row has a cell with clickEventJs
        var clickJsCell = row.cells.SingleOrDefault(cell => cell.alias == "clickEventJs");
        if(clickJsCell !=null){
           //Do something with that value...
Please Sign in or register to post replies

Write your reply to: