I have tried several ways to do this and none give the effect that I want.
I have a grid with a custom commanditem template. It has standard buttons for edit actions on selected grid item.
lnkRootCause is a little different. the link navigates to another page passing an arg in the querystring. the arg is the grid.selectedvalue
the problem is that NavigateURL is not evaluating properly
its evaluating to ...
it would be nice if I could keep this in markup as it makes it simple.
If there is another more standard way to accomplish this please let me know.
to summarize I want to ...
1) Select a row in grid.
2) Click a button in CommandItem
3) Navigate to another page passing variables from the GridDataItem of the selected row in the querystring.
I have a grid with a custom commanditem template. It has standard buttons for edit actions on selected grid item.
<CommandItemTemplate> |
<div style="padding: 0 5px;margin:5px 5px 5px 5px;"> |
<asp:HyperLink runat="server" ID="lnkAddNew" NavigateUrl="CreateWaiver.aspx"><img style="border:0;vertical-align:middle; margin-right:3px;" alt="" src="IMAGES/GridWebBlue/AddRecord.gif" />Create New Waiver</asp:HyperLink> |
<asp:HyperLink runat="server" ID="lnkRootCause" NavigateUrl='RootCause.aspx?id=<%# RadGrid1.SelectedValue.ToString() %>' Visible='<%# RadGrid1.EditIndexes.Count == 0 && !RadGrid1.MasterTableView.IsItemInserted %>'>Root Cause</asp:HyperLink> |
<asp:LinkButton ID="cmdRootCause" runat="server" CommandName="RootCause.aspx" Visible='<%# RadGrid1.EditIndexes.Count == 0 && !RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/sign_question.png" />Root Cause</asp:LinkButton> |
<asp:LinkButton ID="cmdApproval" runat="server" CommandName="ApproveWaiver.aspx" Visible='<%# RadGrid1.EditIndexes.Count == 0 && !RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/sign_tick.png" />Approve Selected Waiver</asp:LinkButton> |
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="CreateWaiver.aspx" Visible='<%# RadGrid1.EditIndexes.Count == 0 && !RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/window_text.png" />View Details</asp:LinkButton> |
</div> |
</CommandItemTemplate> |
<ClientSettings EnablePostBackOnRowClick="true"> |
<Selecting AllowRowSelect="True" /> |
</ClientSettings> |
lnkRootCause is a little different. the link navigates to another page passing an arg in the querystring. the arg is the grid.selectedvalue
the problem is that NavigateURL is not evaluating properly
its evaluating to ...
http://localhost:63254/RootCause.aspx?id=<%# RadGrid1.SelectedValue.ToString() %> |
it would be nice if I could keep this in markup as it makes it simple.
If there is another more standard way to accomplish this please let me know.
to summarize I want to ...
1) Select a row in grid.
2) Click a button in CommandItem
3) Navigate to another page passing variables from the GridDataItem of the selected row in the querystring.