Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using igtbl_addNew for Infragistics Ultrawebgrid

Posted on 2004-10-05
2
Medium Priority
?
6,312 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

927 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