Thursday, June 20, 2013

Use Eval to run javascript method inside item template of radgrid

This works :
                <telerik:GridTemplateColumn HeaderText="Edit">
                        <ItemTemplate>
                            <asp:Button runat="server" Text="Edit" AutoPostBack="False"
 OnClientClick='<%# String.Format("openAddContact({0})",Eval("ID"))%> '></asp:Button>

                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
 
This doesn't:
                <telerik:GridTemplateColumn HeaderText="Edit">
                        <ItemTemplate>                        
     <telerik:RadButton ID="Button1" runat="server" Text="Edit" 
 AutoPostBack="False" 
 OnClientClicked='<%# String.Format("openAddContact({0})",Eval("ID"))%> '>
            </telerik:RadButton>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
intersting hah 

No comments:

Post a Comment