views:

90

answers:

1

Hi,

In the AspxGridView there are two comboboxes in DataItemTemplate, manually loaded. So when user selects one field of the first combo second will be disabled, i wrote this:

<dxe:ASPxComboBox ID="cmbEqualNotEqual" runat="server" 
                                                ClientInstanceName="cmbCEqualNotEqual" EnableClientSideAPI="true">
                                                <Items>
                                                    <dxe:ListEditItem Text=" " Value="0" />
                                                    <dxe:ListEditItem Text="Eşittir" Value="1" />
                                                    <dxe:ListEditItem Text="Eşit Değildir" Value="0" />
                                                </Items>
                                                <ClientSideEvents SelectedIndexChanged="function(s,e){
                                                    alert(s.GetEnabled());
                                                    var selectedIndex = s.GetSelectedIndex();
                                                    if(selectedIndex == 2)
                                                    {
                                                        cmbCBiggerSmaller.SetEnabled(false);
                                                    }
                                                }" />
                                            </dxe:ASPxComboBox> 

But this code disables the combo at the last row, not the row user works on. How can i disable the row user works on?

Thanks

A: 

Hi,

The problem appears because the ClientInstanceName property is set for all editors in the same column to the same value. A possible solution is to handle the HtmlRowCreated event of the ASPxGridView and set the ClientInstanceName for both editors to a unique value. Also, in this event handler you should write the client side SelectedIndexChanged event handler. Finally, to obtain an editor instance, use the ASPxGridView's FindRowCellTemplateControl method.

Also, the following article can be helpful to you:

http://www.devexpress.com/Support/Center/ViewKBIssue.aspx?kbid=K18282

DevExpress Team
Worked very good, thank you very much.
mehmetserif