This is a migrated thread and some comments may be shown as answers.

How to use a hyperlink column to redirect to a new and load details in a radgrid

2 Answers 277 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Louven
Top achievements
Rank 1
Louven asked on 22 Aug 2012, 01:32 PM
Hi
I am fairly new to programming and I am using telerik radgrid to display a list of quotes for a sales application on a quote.aspx page. I have created a Hyperlink column that will redirect a user to a editquote.aspx page which will allow the user to edit specific details(product description,supplier...) of the particular quote they have chosen. The problem I am having is getting to display the chosen quote details on the editquote.aspx page in a radgrid in which they can use inline editing etc. Is there any help that I can get from the support team or anyone else on how to do this?

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Aug 2012, 04:29 AM
Hi,

Try the following code to achieve your scenario.
aspx:
<telerik:GridHyperLinkColumn DataTextField="OrderID" UniqueName="Link" DataNavigateUrlFields="OrderID" DataNavigateUrlFormatString="EditPage.aspx?OrderID={0}">
</telerik:GridHyperLinkColumn>
EditQuote.aspx
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="false" onitemdatabound="RadGrid1_ItemDataBound">
   <MasterTableView DataKeyNames="OrderID" EditMode="InPlace">
    <Columns>
     <telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderId"></telerik:GridBoundColumn>
    </Columns>
   </MasterTableView>
</telerik:RadGrid>
C#:
protected void Page_Load(object sender, EventArgs e)
{
 data = Request.QueryString["OrderID"];
}
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 if (e.Item is GridDataItem)
 {
   GridDataItem ditem = (GridDataItem)e.Item;
   string key = ditem.GetDataKeyValue("OrderID").ToString();
   if (key == data)
  {
     ditem.Edit = true;
  }
 }
}

Thanks,
Shinu.
0
Louven
Top achievements
Rank 1
answered on 23 Aug 2012, 09:56 AM
Hi Shinu

Firstly, Thank you for your response i appreciate it. I have tried to implement the code you have given me but it does not solve my problem as it redirects me to the editquote.aspx page but it does not load the radgrid with the details of that particular quote. I think the problem might be that the two radgrids are referring to two different tables . But I tried manipulating your code to fit in but when it redirects it loads the grid with all the details of the datasource. All i need is for it do this 

Grid / Master/Details Client-Side Binding- http://demos.telerik.com/aspnet-ajax/grid/examples/clientmasterdetails/defaultcs.aspx.


But instead of displaying the bottom grid on the same page it should display on another page. If you any ideas could you please let me know.
Thank you
Tags
Grid
Asked by
Louven
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Louven
Top achievements
Rank 1
Share this question
or