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

[Solved] RadGrid Edit/Insert

1 Answer 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zinoviy Margovskiy
Top achievements
Rank 1
Zinoviy Margovskiy asked on 30 Jun 2009, 03:03 PM
Hi telerik,

Hopefully this one is easy...

I have a rad grid with following columns: Supplier, ProductName, Product Description.  These columns constitute an entity called line item.
On edit/insert I am using inline mode. Now, when in edit/insert mode users are able to search for supplier by supplier name or for a product by product name (I have a search icon next to each entry fields in edit/insert mode which will open a pop-up).  Once, values are selected for these fields I also need to store IDs for them behind the scene (for Supplier and for Product),
so for example my OnInsertCommand would look like this:
 
   protected void RadGrid1_OnInsertCommand(object source, GridCommandEventArgs e)
    {
        GridEditableItem item = null;
        string supplierID = String.Empty;
        string productID = string.Empty;

        item = this.RadGrid1.MasterTableView.GetInsertItem();

       // Get supplier ID for and assign to supplierID variable
          .................
        // Get product ID and assign to productID variable
       
        //Create new LIne Item
        LineItem llineItem = new LineItem();
        llineItem.GenerateALineItem(supplierID, productID, this.CurrentOrder.OrderID);
        this.CurrentOrder.Order.LineItem.Add(llineItem.GetItem());
        RadGrid1.MasterTableView.Rebind();
    }

How and where can I store these supplierID, productID for edited/new records to retrieve them in these methods (OnInsertCommand
OnItemUpdated)

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 01 Jul 2009, 08:49 AM
Hello Zinoviy,

Does passing the supplier and product ids back from the popup search form using Session or Stack object an applicable solution for your case? If so, review the implementation from the following KB article on our site and modify the logic accordingly to fit in your configuration schema.

In case you prefer client-side approach, refer to the forum thread linked in this public post you started before:
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-editform-and-tooltipmanager.aspx

Best regards, Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Zinoviy Margovskiy
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or