views:

119

answers:

5

Hi,

I got this error when i press a button, but i searched for that ID 'DXSelBtn0' i couldn't find it. Button is a Devexpress button, and i just add click event to it thats all. When i delete the event, i don't get that error. What should i do?

Thanks Mehmet Şerif Tozlu

A: 

If you are creating the button programatically, make sure you explicitly set the Id of the control to something unique. Or if you are in a loop, make sure you explicitly define a unique id for each control.

NerdFury
I don't create the button programatically, here is the code to create it :<dxe:ASPxButton ID="btnAddToList" runat="server" AutoPostBack="False" OnClick="btnAddToList_Click" Text="Listeye Ekle" ClientInstanceName="btnAdd"></dxe:ASPxButton>When i delete OnClick="btnAddToList_Click", i don't get the error.
mehmetserif
Are you using any other DevExpress controls? You say removing the event handler fixes the problem, but do you see the problem when you click the button, or just on a normal page load? What are you attempting to do in the click event?
NerdFury
Yes, i use other Devexpress controls but there is only one Button control. When i click the button i see the error page. On page load there is no problem. I try to get selected rows' values of an AspxGridView control on the click event.
mehmetserif
A: 

The DXSelBtn is a prefix used to generate IDs for select checkBoxes in the command column of the ASPxGridView. I tend to think that you are manipulating the grid in some way. Sorry, it is impossible to tell what causes this issue without your code.

DevExpress Team
A: 

Yes i added 3 more GridViewCommandColumn to have 3 more checkboxes at run-time, actually i can add them in Design-time but does it change anything? and how can solve this issue, here is the code to add those columns:

GridViewCommandColumn coEqual = new GridViewCommandColumn();
        coEqual.Caption = "Eşittir";
        coEqual.Name = "Eşittir";
        coEqual.VisibleIndex = 7;
        coEqual.ShowSelectCheckbox = true;
        coEqual.CellStyle.HorizontalAlign = HorizontalAlign.Center;

    detailGrid.Columns.Insert(7, coEqual);

Thanks,

mehmetserif
Hmm, what is the goal of having three command columns with the SelectionCheckBox in the same grid?
DevExpress Team
User will select one or more row and for each row he will select "equal-not equal-bigger" checkboxes. But those fields not in the datasource so i will handle the selections programatically. I tried to have 3 GridViewDataCheckColumn but because of they are not in the datasource checkboxes come with question marks and cannot use them.
mehmetserif
A: 

I would suggest that you create unbound columns instead as it is described in the topic available at:

http://documentation.devexpress.com/#AspNet/CustomDocument3732

DevExpress Team
I tried unbound columns but i still get question marks so i cannot select those fields, am i missing something?
mehmetserif
I don't want to use Edit mode of the AspxGridView, instead of that i want user to select those unbound columns without getting into the edit mode.
mehmetserif
A: 

I added unbound columns at run-time on AspxGridView.Init event but this i got question marks on those fields so i cannot select checkboxes. What can i do to solve this problem or to select them should user edit the row but i don't want user to edit the row. Here is what i did to add those unboundcolumns:

GridViewDataCheckColumn coEqual = new GridViewDataCheckColumn();
            coEqual.Caption = "Eşittir";
            coEqual.Name = "Eşittir";
            coEqual.UnboundType = DevExpress.Data.UnboundColumnType.Boolean;
            coEqual.VisibleIndex = 7;

            coEqual.CellStyle.HorizontalAlign = HorizontalAlign.Center;
            detailGrid.Columns.Add(coEqual);

I really need this, thank you.

mehmetserif