J
james
Hi
I disable the view state within my datagrids using the code below...
private void Page_PreRender(object sender, EventArgs e) {
foreach (DataGridItem dataGridItem in dgdData.Items)
dgdData.EnableViewState = false;
}
I also always include the add and details buttons to the datagrid
within a template column as below...
<asp:TemplateColumn>
<HeaderTemplate>
<asp:Button ID="btnAdd" runat="Server"
CommandName="Add" Style="width: 50px" Text="Add" />
</HeaderTemplate>
<ItemTemplate>
<asp:Button ID="btnDetails" runat="Server"
CommandName="Details" Style="width: 50px" Text="Details" />
</ItemTemplate>
</asp:TemplateColumn>
The problem that I am experiencing is that for some data grid views,
clicking on a button results in a postback and a call to the oncommand
member function, but not to the prerender. This is as expected.
For others, the postback is called, the oncommand member function is
not called, but the prerender function is. This seems bizarre.
Has anyone else come across this. Is is a Microsoft bug?
Regards
James
I disable the view state within my datagrids using the code below...
private void Page_PreRender(object sender, EventArgs e) {
foreach (DataGridItem dataGridItem in dgdData.Items)
dgdData.EnableViewState = false;
}
I also always include the add and details buttons to the datagrid
within a template column as below...
<asp:TemplateColumn>
<HeaderTemplate>
<asp:Button ID="btnAdd" runat="Server"
CommandName="Add" Style="width: 50px" Text="Add" />
</HeaderTemplate>
<ItemTemplate>
<asp:Button ID="btnDetails" runat="Server"
CommandName="Details" Style="width: 50px" Text="Details" />
</ItemTemplate>
</asp:TemplateColumn>
The problem that I am experiencing is that for some data grid views,
clicking on a button results in a postback and a call to the oncommand
member function, but not to the prerender. This is as expected.
For others, the postback is called, the oncommand member function is
not called, but the prerender function is. This seems bizarre.
Has anyone else come across this. Is is a Microsoft bug?
Regards
James