?
Solved

Populating the values of subsequent columns in an Infragistics UltraWebGrid, based on the first column's selected value in a ValueList/Dropdownlist

Posted on 2008-10-16
5
Medium Priority
?
2,556 Views
Last Modified: 2013-12-14
I'm using a Infragistics UltraWebGrid.  I have a couple of columns in a grid, the first column has a dropdownlist in it.  When the user adds a new row, the row is empty which is correct, i want all the columns of the new row to be populated with the first column's default data which is found in it.

Steps that the user will perform when adding a new row to the grid:
1)  The user adds a new row to the grid, the row is now empty.
2)  The user clicks on the first column of new row, and dropdown appears with customer items.
3)  The user selects an cutomer item in the dropdown.
4)  After he selected an item from the dropdown, the rest of the columns must display the customer's default data, like CustomerID, Address, Telephone, etc based on the selected item.

The dropdown/valuelist is already populated in the new row, I don't know what event to use, to fill the subsequent columns based on the value of the first columns dropdownlist after the user chose an item.  The grid's "AddRow" event is not sufficient since this only gets fired once the user entered all the data and moves to another row, and in order for the user to add the data, he needs the default data in the cells, and then he can modify it.

I've considered using the Dropdownlist's "SelectedIndexChanged" event, but since the user is busy adding a new row, there is no way for me to find the new row being added, because the "code" does not know of this new row yet.

The dropdownlist in the first Column is a WebCombo control also from infragistrics.  So this will allow me to add all the neccessary customer data in it, since it is has a multicolumn grid.

I have seen some solutions solving this using a UltraWinGrid which is the Window Application version of Infragistics, but not for an UltraWebGrid which is used in ASP.Net.

I envision that some javascript will be neccessary to perform the following:
1) Find the selected row in the first columns dropdownlist
2) Get all the default data stored in that selected row (Since this is a row of a multicolumn grid)
3) Display the values in the the subsequent columns.

When the user finished with editing the default values, he can click on another row, and i can use the "AddRow" event to find all the data that he entered and submit it to my dataset.

I'm new to using the Infragistics control suite, and can't seem to find any good code references and solutions to programming questions.

thanks
0
Comment
Question by:Caroline_Swart
  • 2
  • 2
4 Comments
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 22748165
>>>> I've considered using the Dropdownlist's "SelectedIndexChanged" event,
>>>> but since the user is busy adding a new row, there is no way for me to
>>>> find the new row being added, because the "code" does not know of this new row yet.

That seems a wrong conclusion for me. I don't know where the user added the new row but most likely it is below the other rows. Hence, retrieving the count of rows from the grid would tell you where the the new row was added. Moreover, when handling Dropdownlist's "SelectedIndexChanged", there will be methods - unfortunately I don't know UltraWebGrid but any grid would provide such methods - to find out where the current drop-down control was located within the grid. S, in any case you would be able to find out whether it was the new empty row hwhere the drop-down was made or whether it was a change for any of the other rows.

0
 

Author Comment

by:Caroline_Swart
ID: 22755717
You are correct that the new row gets added beneath the existing rows. The UltraWebGrid gives you almost the same functionality as the "grids" used in access, if you click on the last empty row, it inserts a new row into the grid.  However this new row gets added client side, so the server does not yet know that the row exists - Now i don't know if this is where my problem is - maybe the server does know, and it's me who don't know what method to use..

I was considering Javascript since the row was added clientside. I don't understand what you mean by "there will be methods - unfortunately I don't know UltraWebGrid but any grid would provide such methods - to find out where the current drop-down control was located within the grid", if you can maybe be more specific.

0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 1500 total points
ID: 22756421
I mean that if you can handle an event like SelectedIndexChanged that there are methods to find out which row and column the active combobox currently has. Normally this information was passed to the handler (or a handle was passed which could be used for a query).
0
 

Author Closing Comment

by:Caroline_Swart
ID: 31506682
thanks i never thought of that
0

Featured Post

Technology Partners: 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

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

850 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