Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Using igtbl_addNew for Infragistics Ultrawebgrid

Posted on 2004-10-05
2
6,276 Views
Last Modified: 2008-09-08
How can I use the igtbl_addNew javascript to add a row with a particular style? e.g. what do I do to make sure that the new rows added are all of a particular colour? In case igtbl_addNew cannot be used directly, is there any other way I can change the colour of that particular row using javascript?
0
Comment
Question by:sujata_majumder
  • 2
2 Comments
 
LVL 10

Expert Comment

by:jnhorst
ID: 12233966
The Infragistics webgrid control has a series of client-side event.  If you show the properties of the grid, there should be an expandable entry called ClientSideEvents.  I cannot remember the exact name but I know there is a client side event for when a row is added to the grid by clicking the add button.  What you do with that is specify the name of a function that you will define in the header section of your HTML.  Write up that function (make sure the name is the same as what you put in the property for the event).  If you have the NetAdvantage installed on your dev machine, you should be able to navigate your Programs menu to help files for the web grid.  Look for the "Client Side Object Model" contents section of the help file and it will have all of the client side JavaScript objects, one of which represents a grid row.  It will have examples of how to resolve the row in question and apply styles to it, which is what you will do in order to change the color of the row.

John
0
 
LVL 10

Accepted Solution

by:
jnhorst earned 500 total points
ID: 12234695
An update:

I reinstalled by NetAdvantage 2003 Vol. 1 and was able to do what you are trying to do.  Add this into the <head></head> section of your html:

<script language="javascript">
function rowInserted(gn, id)
{
     var newRow = igtbl_getActiveRow(gn);
     newRow.Element.style.backgroundColor = "#fff321";
}
</script>

Then right click your UltraWebGrid, select Properties and expand the DisplayLayout property.  There you will find ClientSideEvents.  Expand this and enter "rowInserted" (without the quotes) in the AfterRowInsertedHandler property.  This is the name of your JavaScript function.

And that is it.  You can change the color code (#fff321 in my example above) as your needs require.

My JavaScript code above is IE compliant, and may or may not work in other browsers.  The help file available on your machine (if you have Infragistics installed) has a lot of examples and is actually rather good (as far as help files go).  You made a good choice going with Infragistics.

John
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question