There is an easy fix for the scenario.
What I did was set the ClientIDMode to "Predictable" on the gridview. I also set ClientIDRowSuffix to the name of the Primary Key field of my datasource. What is nice about using "Predictable" is that the ClientID values do not contain strings like "ctlxxx". Here is a quick example:
<asp:GridView ID="gvGroups" runat="server" AllowPaging="True" SkinID="GridView"
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="GroupID" ClientIDMode="Predictable" ClientIDRowSuffix="GroupID"
DataSourceID="SqlDataSourceGroups" OnRowCommand="gvGroups_RowCommand">
0 comments:
Post a Comment