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
2501
Issue related to WebPercentEditor as on 30th August 2010
posted
Hi,

     To a particular column of the Grid I am binding a WebPercentEditor control. In that control if a value entered is greater than 100, than a prompt needs to come up. How to achieve that? Please, kindly send us a sample in VB.NET Code on the same.

   Currently, what happens is that on blur of that control if the value entered exceeds 100, it changes to 100 by default. But what we want is to alert the User on the same. So, how to achieve that?

Thank You,
Regards,
Parents
No Data
Reply
  • 2501
    posted

    Hello,


    There are two client-side events for the UltraWebGrid, the CellChangeHandler or the BeforeCellChangeHandler event, which may be used.  Both client-side events will fire each time a Cell is tabbed to or selected in the UltraWebGrid.  In either of these two events, the current Cell ID is the parameter to use for checking the Column Key the Cell is located in.


    If the Column Key is not equal to the Column which contains the WebPercentEdit, then the event may be cancelled to avoid having an Alert Box display for every Cell. 


    If the Column Key is equal to the Column which contains the WebPercentEdit, then the Value for the Cell may be checked and if the Value is greater than 100%, an Alert Box containing the Cell Value may be displayed to the user.


    The following code snippet demonstrates using an Alert Box in the CellChangeHandler to display an Alert when the Cell Value for the current Cell is greater than 100:


             function ug_CellChangeHandler(gridName, cellId)
             {
                   var cell = igtbl_getCellById(cellId);
                   var col = cell.Column;
                   if ((col.Key == "Column 1") && (cell.getValue() > 100))
                   {
                         alert( "The current Cell Value is " + cell.getValue());
                   }
             }


    The WebPercentEditor does has a Blur property in the TextEditorClientEvents that you should be able to use as well.  Please see the following link to the NetAdvantage Online Help for ASP.NET where information on the WebPercentEditor Blur property in the TextEditorClientEvents may be found:


             TextEditorClientEvents Class Members
             <http://help.infragistics.com/NetAdvantage/ASPNET/Current/CLR4.0/?page=Infragistics4.Web.v10.2~Infragistics.Web.UI.EditorControls.TextEditorClientEvents_members.html>


    The WebPercentEditor also has two Client-Side Events which you may use, the Client-Side Blur and Focus events.  Information on both of these events may be found in the above link as well.


    Please let me know if you have any questions.


    Thank you.


    Sincerely,
    Mike D.
    Developer Support Engineer
    Infragistics
    www.infragistics.com/support

Children
No Data