Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
Webgrid Column BaseColumnName
posted

Hi,

 Is there anyway to retrieve the BaseColumnName of a column in JavaScript? I can get access to each cell by using var myCell = row.getCell(0). I can then get the Key value of the column, but I can't seem to find the BaseColumnName. Can anyone point me in the right direction on this?

Thanks

  • 7694
    posted

     

    Hello,

    You can use the property CellClickHandler of ClientSideEvents tag and with  javascript code below you can get BaseColumnName of table.

    ...

       <ClientSideEvents CellClickHandler="GetHeaderText" />

     ...

      <script type="text/javascript">

        function GetHeaderText(gridId,cellId){

        var headerText = igtbl_getCellById(cellId).Column.HeaderText;

         }

       </script>

    Hope this helps.