﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - JavaScript ColumnName WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/JavaScript-ColumnName-WebGrid/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>JavaScript ColumnName WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/JavaScript-ColumnName-WebGrid/</link><pubDate>Thu, 29 Oct 2009 05:45:24 GMT</pubDate><dc:creator>Attila</dc:creator><description>&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Here is what I did:&lt;/p&gt;&lt;span style="font-size: 13px"&gt;&lt;pre&gt;function WebGrid1_OnEnterEditMode(controlId, tblName, editObject) {
            var WebGrid1 = ISGetObject(controlId);
            alert(wgGetColNameByCell(editObject.cellElement));
            return true;
}&lt;/pre&gt;&lt;p&gt;&lt;a href="http://support.intersoftpt.com/Default.aspx?pid=101&amp;amp;type=Knowledge Base&amp;amp;nodeId=225" target="_blank"&gt;More Info&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;BTW... I guess I've marked the wrong post as answer. Is it possible to unmark it? Ty&lt;/p&gt;&lt;/span&gt;</description></item><item><title>JavaScript ColumnName WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/JavaScript-ColumnName-WebGrid/</link><pubDate>Thu, 29 Oct 2009 02:34:21 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;You will need to set CellClickAction="CellSelect" on layout settings in order to make the event to be called. If you want to use EnterEditMode client side event, you can fill the index automatically with editObject.cellElement.cellIndex-1.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>JavaScript ColumnName WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/JavaScript-ColumnName-WebGrid/</link><pubDate>Wed, 28 Oct 2009 08:19:31 GMT</pubDate><dc:creator>Attila</dc:creator><description>&lt;p&gt;Hello Handy,&lt;/p&gt;&lt;p&gt;Thank you for your reply, but unfortunally this code isn't working...&lt;/p&gt;
&lt;p&gt;Im
having trouble at cellIndex parameter, wich is getting undefined. By
the way... i need to use the code as "OnEnterEditMode" (I suppose it
would work just as same).&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I've tried with "OnCellSelect" too, but it didn't even fired...&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;ClientSideEvents OnCellSelect="WebGrid1_OnCellSelect" /&amp;gt;&lt;/pre&gt;</description></item><item><title>JavaScript ColumnName WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/JavaScript-ColumnName-WebGrid/</link><pubDate>Wed, 28 Oct 2009 03:25:52 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;So, you would like to get also the current cell index and want to put the index automatically to retrieve column Name's, correct? I have snippet codes and hope this would help.&lt;/p&gt;&lt;p&gt;e.g&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;var cellSel;
function WebGrid1_OnCellSelect(controlId, tblName, rowIndex, cellIndex)
{
    var WebGrid1 = ISGetObject(controlId);
    cellSel = cellIndex;
    alert(WebGrid1.GetSelectedObject().ToRowObject().GetCells()[cellIndex].Name);
    return true;
}
function Button1_onclick() 
{
    var WebGrid1 = ISGetObject("WebGrid1");
    if (WebGrid1.GetSelectedObject() == null) 
    {
      alert("Select a cell or a row");
    } else {
        alert(WebGrid1.GetSelectedObject().ToRowObject().GetCells()[cellSel].Name);
    }
}&lt;/pre&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>JavaScript ColumnName WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/JavaScript-ColumnName-WebGrid/</link><pubDate>Tue, 27 Oct 2009 13:36:46 GMT</pubDate><dc:creator>Attila</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I'm having some trouble figuring it out... I know that I need to do this code to get WebGrid's column name by selecting a cell:&lt;br /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;pre&gt;var grid = ISGetObject("WebGrid1");&lt;br /&gt;var rowElm = grid.GetSelectedObject().GetRowObject().GetElement();&lt;br /&gt;var columnName = wgGetColNameByCell(rowElm.cells[3]);&lt;br /&gt;alert(columnName);&lt;/pre&gt;
&lt;p&gt;But... how can I do it without knowing the index for "3" ? I mean, I need to get that number too...&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;rowElm.cells[3]&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Sorry if not well explained... but I need to leave know. &lt;img style="border: medium none ;" src="../../../WebResources/Images/Community/Editor/smiley1.gif" id="" /&gt; &lt;/p&gt;</description></item></channel></rss>