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

RadGrid Edit Mode with Rad Window Dialog

3 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 22 Dec 2008, 06:24 AM
Hi,

I am using Rad Grid and have edit item template. Edit Mode popup, I have a button and call the dialog. When I call the dialog, I have to pass one value from edit mode popup. E.g. Category and Product. You choose the category and click the button. On dialog, need to show products base on category that we choose on edit mode popup.

I am facing the problem when I pass the category info to dialog on edit mode. The value always show null.

Please let me know if there is any solutions.

Alex

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 22 Dec 2008, 12:17 PM
Hi Alex,

To see more information on the requested functionality, please refer to the following example.
I hope this helps!

Greetings,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Alex
Top achievements
Rank 1
answered on 29 Dec 2008, 10:34 AM
Hi,

Thanks for your info. I know how to call the Dialog when click the link button in grid.

My problem is that when i click the auto generated edit buttton and then show the edit poppup that radgird support automatically. I put the button in edit item template. when click the button, i need to pass the data to dialog. But I can't get the data from java script function when grid is in edit mode.

Regards,
Alex
0
Princy
Top achievements
Rank 2
answered on 29 Dec 2008, 11:10 AM
Hello Alex,

Try out the following code to access the button in the EditForm and then set an OnClick atribute to it.
aspx:
 <telerik:GridBoundColumn DataField="ProductName" UniqueName="ProductName1"></telerik:GridBoundColumn> 
 <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn> 
 <telerik:GridTemplateColumn> 
        <EditItemTemplate> 
                 <asp:Button ID="Button1" runat="server" Text="Button" /> 
        </EditItemTemplate> 
 </telerik:GridTemplateColumn> 

cs:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
       if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
            { 
                GridEditableItem item = (GridEditableItem)e.Item; 
                TextBox txtbx = (TextBox)item["ProductName1"].Controls[0]; 
                string strtxt = txtbx.Text; 
                Button editLink = (Button)e.Item.FindControl("Button1"); 
                editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}');", strtxt); 
            } 
    } 

Thanks
Princy.
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Alex
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or