Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
325
UltraWebGrid - DropDownList and Javascript
posted

Hi there!

I have an UltraWebGrid with following column defined:

<igtbl:TemplatedColumn IsBound="true" Key="PerformanceType" Type="DropDownList" >
<Header Caption="Type" >
</Header>
<ValueList DisplayMember="Name" ValueMember="ID">
<Style Width="170px" font-size="9px" Font-Names="Arial" ></Style>
</ValueList>
</igtbl:TemplatedColumn>

There is some Javascript code that fills up the grid and the ValueList which works well:

 

function onPerformanceResponse(result) {
fnUnhideRows();

var oGrid = igtbl_getGridById('<% =uwgPerformance.ClientID %>');

for (var i = 0; i < result.length; i++) {

var nrow = oGrid.Rows.getRow(i);

if(nrow != null) {

var pp = result[i];

nrow.getCellFromKey('PerformanceID').setValue(pp.PerformanceID, false);

nrow.getCellFromKey('PerformanceType').setValue(pp.PerformanceType, false);

nrow.getCellFromKey('Year').setValue(pp.Year, false);

nrow.getCellFromKey('Sales').setValue(pp.Sales_M, false);

nrow.getCellFromKey('Sales_F').setValue(pp.Sales_F_M, false);

nrow.getCellFromKey('Ebitda').setValue(pp.Ebitda_M, false);

nrow.getCellFromKey('Ebitda_F').setValue(pp.Ebitda_F_M, false);

nrow.getCellFromKey('Ebit').setValue(pp.Ebit_M, false);

nrow.getCellFromKey('Ebit_F').setValue(pp.Ebit_F_M, false);

nrow.getCellFromKey('NetIncome').setValue(pp.NetIncome_M, false);

nrow.getCellFromKey('NetIncome_F').setValue(pp.NetIncome_F_M, false);

nrow.getCellFromKey('CurrencyRate').setValue(pp.CurrencyRate, false);

}

}

}

function fnUnhideRows() {

var oGrid = igtbl_getGridById('<% =uwgPerformance.ClientID %>');

for (var i = 0; i < oGrid.Rows.length; i++) {

var row = oGrid.Rows.getRow(i);

row.setHidden(false);

}

fnAssignPerformanceType();

}

function fnAssignPerformanceType() {

var oGrid = igtbl_getGridById('<% =uwgPerformance.ClientID %>');

var col = oGrid.Bands[0].getColumnFromKey('PerformanceType');

var result = GetSynchronousJSONResponse('<%= Page.ResolveUrl("~/Data/PositionDataService.asmx/GetPerformanceTypeEnum") %>', null);

result = eval('(' + result + ')').d;

var vlist = new Array(result.length);

for (var i = 0; i < result.length; i++) {

var item = result[i];

vlist[i] = new Array(item.ID, item.Name);

}

col.ValueList = vlist;

}

But if I select a value of the dropdownlist and select the next cell in the grid the column "PerformanceType" shows the "ValueMember" (ID) value instead of the "DisplayMember" (Name)?!?

Please can anybody help me? Thanks!

Kind Regards,
Dan

  • 49378
    posted

    Hi Dan,

    It has been a while since your post, however in case you still need assistance with this matter I would be glad to help.

    I investigated your scenario, but am so far unable to replicate the described issue using .NetAdvantage 11.1 under Mozilla 7 and IE9. Attached is my test sample which employs the InitializeLayout client-side event to populate the dropdown.  In order to investigate this further I would need to know which version of .NetAdvantage you are using.

    Please let me know if you have any questions.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://ko.infragistics.com/support

    UltraWebGridDropDownListJavascript.zip