Infragistic webgrid Column collection

M

miqbal

How can I loop through the columns collection in client side javascript?
Or how can I get a column by the key, not just by the index in the
collection? in Infragistics webgrid
Thanks
 
A

Anatoly

Wrong forum.
Look at
http://www.infragistics.com/support/newsgroups.asp
BUT since you asking:

This example counts the columns of each band. For one column, (Phone) the
column is made non-editable.

function CountColumns(btnEl) {
// Count all columns and place the value into the label field
// Use the variable automatically declared for the grid on the page.
var oGrid = oUltraWebGrid1;
// Get the Bands collection
var oBands = oGrid.Bands;
// Get the columns collection for Band 0
var oBand = oBands[0];
var oColumns = oBand.Columns;
// The column count is equal to the length of the Columns array.
var count = oColumns.length;
var total = 0;
// Add up the number of columns in each band.
for(i=0; i<oBands.length; i++) {
oBand = oBands;
total += oBand.Columns.length;
// iterate the columns of the band
for(c = 0; c < oBand.Columns.length; c++) {
var column = oBand.Columns[c];
if(column.Key == "Phone")
column.AllowUpdate = 2; // AllowUpdate.No
}
}
}HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top