Solved

Using igtbl_addNew for Infragistics Ultrawebgrid

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

24 Experts available now in Live!

Get 1:1 Help Now