Solved

Using igtbl_addNew for Infragistics Ultrawebgrid

Posted on 2004-10-05
2
6,265 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Achieve json result 2 65
SQL best practice question 3 36
Replace &lt; with < 14 56
Turn on intranet settings 1 39
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now