L
Liza
Hi
I have a problem gettting the right data in my CommandArgument after I
applyed a rowfilter.
My template column looks somewhat like this:
<asp:TemplateColumn HeaderText="ErrorID">
<HeaderStyle Width="30%" CssClass="folderHeader"></HeaderStyle>
<ItemTemplate>
<asp:LinkButton runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.MyId") %>' CommandName="Details" CommandArgument='<%#
DataBinder.Eval(Container, "DataItem.MyId") %>'
CausesValidation="false" ID="lnkbtnDetails">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
First I bind my datagrid to the datatables default view and everything
works fine. When clicking an item, I get the right ID
Then I apply a rowfilter on the dataview and bind again to the
datagrid:
.....
lDv.RowFilter = "SiteId = " & txtSiteID.Text
dtgItems.DataSource = lDv
dtgItems.DataBind()
Now I get only a few items but when clicking details on, for instance
the second item, in the CommandArgument I get the id from the second
item on the default view and not the second item from the the filtered
view.
Any ideas?
/Liza
I have a problem gettting the right data in my CommandArgument after I
applyed a rowfilter.
My template column looks somewhat like this:
<asp:TemplateColumn HeaderText="ErrorID">
<HeaderStyle Width="30%" CssClass="folderHeader"></HeaderStyle>
<ItemTemplate>
<asp:LinkButton runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.MyId") %>' CommandName="Details" CommandArgument='<%#
DataBinder.Eval(Container, "DataItem.MyId") %>'
CausesValidation="false" ID="lnkbtnDetails">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
First I bind my datagrid to the datatables default view and everything
works fine. When clicking an item, I get the right ID
Then I apply a rowfilter on the dataview and bind again to the
datagrid:
.....
lDv.RowFilter = "SiteId = " & txtSiteID.Text
dtgItems.DataSource = lDv
dtgItems.DataBind()
Now I get only a few items but when clicking details on, for instance
the second item, in the CommandArgument I get the id from the second
item on the default view and not the second item from the the filtered
view.
Any ideas?
/Liza