Solved

Using igtbl_addNew for Infragistics Ultrawebgrid

Posted on 2004-10-05
2
6,288 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
[X]
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
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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