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

[Solved] Radgrid onrowclick event have to open new radgrid

1 Answer 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
noyan
Top achievements
Rank 1
noyan asked on 01 Apr 2009, 08:29 AM
I got a radgrid which shows customers. When user clicked one of the customers at left side I have to show products we sold to the customers.
Even if I know when row selected "onrowselect" client side event fire. I dont know how I pass key value to the other grid I used to show products we sold selected customer. Moreover, before user clicked one of customer rows I have not to show sold products radgrid.

So, shortly I have to radgrid when one of the grid row selected other radgrid will be populated and become visible, thank you in advance and all helps will be appreciated. Thank you in advance.

1 Answer, 1 is accepted

Sort by
0
Accepted
nagarjun
Top achievements
Rank 1
answered on 01 Apr 2009, 01:19 PM
Initially keep Grid2 visible mode to false. In Grid1 select property  onitemcommand="RadGrid1_ItemCommand", which is present in Grid events and keep clientside events as:

<ClientSettings EnablePostBackOnRowClick="true"></ClientSettings>

in .cs page the code is:

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {
           if (e.CommandName == "RowClick" && e.Item is GridDataItem)
            {
                GridEditableItem editedItem = e.Item as GridEditableItem;
               int customerId = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["CustomerId"]);

             RadGrid2.Visible = true;
               RadGrid2.DataSource =...;
             RadGrid2.DataBind();
           }
        }
Tags
Grid
Asked by
noyan
Top achievements
Rank 1
Answers by
nagarjun
Top achievements
Rank 1
Share this question
or