This is a migrated thread and some comments may be shown as answers.

GridButtonColumn doesn't work at first click hierarchical grid

4 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mbro87
Top achievements
Rank 1
mbro87 asked on 28 Mar 2011, 08:42 AM
Hello, in my hierarchical radgrid, my GridButtonColumn doesn't work at first click.
But works fine at second click on Button.

This is the code:

                                <telerik:GridButtonColumn 
                                    UniqueName="BtnCol" 
                                    ButtonType="ImageButton" 
                                    ImageUrl="Images/Generic/Icons/info.gif"                                  
                                    CommandName="ShowDetails">
                                    <HeaderStyle Width="30px"></HeaderStyle>
                                </telerik:GridButtonColumn>

---

            function ShowDetails(ID1, ID2, rowIndex) {

                var grid = $find("<%= RG1.ClientID %>");
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);
                window.radopen("UserControl/PAGE.aspx?ID1=" + ID1+ "&ID2=" + ID2, "ModalWin");
                return false;
            }

Where is the problem? A JS CallBack?
Thanks!

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Mar 2011, 10:02 AM
Hello,

I am not sure about how you attached the client event to Button control in buttonColumn.

You could use the OnCommand event to RadGrid  and check for the CommandName, then open the window based on that. A sample code you can find here.

JavaScript:
function OnCommand(sender, args) { 
      alert(args.get_commandName());
    // Open window here
}



Thanks,
Princy.
0
mbro87
Top achievements
Rank 1
answered on 28 Mar 2011, 10:19 AM
Thanks for reply but I Can't use this feature because I need to send to radgrid some parameters (ID1 and ID2 by GET Request).
0
farnaz
Top achievements
Rank 1
answered on 01 May 2011, 10:49 AM
hi
i have tha same problem . please help me if u find any solution.
thanks.
0
mbro87
Top achievements
Rank 1
answered on 17 May 2011, 07:44 AM
The princy's solution works fine with a no-hierarchical grid.
Tags
Grid
Asked by
mbro87
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
mbro87
Top achievements
Rank 1
farnaz
Top achievements
Rank 1
Share this question
or