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

Passing values to user defined edit control for RadGrid in DotNetNuke

5 Answers 208 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tigger Tag
Top achievements
Rank 1
Tigger Tag asked on 10 Mar 2011, 12:16 PM
Hi,

I am using RadGrid with my own control as edit control in DNN. I need ModuleConfiguration information in the edit control so that i can load correct data in the listboxes and comboboxes. These values vary by ModuleId. How can I pass ModuleConfiguration or ModuleId to edit control that i created for RadGrid. In the regular case I load the control and then i set the ModuleConfiguration, since the control extends PortalModuleBase. Can you please provide how i can achieve this? I need the solution quickly. I appreciate any help.

Thank you,
Ana

5 Answers, 1 is accepted

Sort by
0
Tigger Tag
Top achievements
Rank 1
answered on 14 Mar 2011, 04:30 PM
Any one?
0
Iana Tsolova
Telerik team
answered on 15 Mar 2011, 04:40 PM
Hi,

Can you elaborate a bit on your scenario? Where in RadGrid you are adding the mentioned edit control?

Greetings,
Iana
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Tigger Tag
Top achievements
Rank 1
answered on 16 Mar 2011, 05:49 PM
Iana,

Thank you for getting back to me! I appreciate it very much.

I am using telerik asp.net ajax grid with DotNetNuke. I am using the grid in the DNN module like this, with user defined edit control (EditTest.ascx).

<telerik:RadGrid ID="_testGrid" runat="server" AllowPaging="true" AllowSorting="True"
  AutoGenerateColumns="False" GridLines="None" OnNeedDataSource="_testGrid_NeedDataSource" OnInsertCommand="_testGrid_InsertCommand"
  ShowStatusBar="true" OnItemDataBound="_testGrid_ItemDataBound" OnUpdateCommand="_testGrid_UpdateCommand"
  OnSortCommand="_testGrid_SortCommand" ShowFooter="true">

<MasterTableView Name="_testMasterTable" CommandItemDisplay="Top" AllowCustomPaging="true"
    DataKeyNames="TestId" Width="100%" EditMode="PopUp">
    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
 

    <Columns>
      <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
        UniqueName="TestEditCommand">
      </telerik:GridEditCommandColumn>
.
.
.
<EditFormSettings UserControlName="~/EditTest.ascx"
      EditFormType="WebUserControl" CaptionFormatString="Edit Test: {0}" CaptionDataField="TestNum"
      PopUpSettings-Width="500px" PopUpSettings-Modal="true">     
      </EditColumn>
    </EditFormSettings>
  </MasterTableView>
.
.
.

I need to pass the DNN's ModuleInfo object to EditTest.ascx when user clicks on edit or add new item to the grid. How do i pass it? In the case where I am not using telerik radgrid, i load the control and then set the ModuleConfiguration (object of ModuleInfo) on the control so that i will have accessto it in the EditTest control. But when I am using RadGrid, i don't load the control, so i don't know how to pass this object to it. Is there a way i can get access to the edit control before it is going to load the data to display it to user?  Is there a event that is fired before the control is displayed to the user that i can use it to set the ModuleConfiguration? Any idea is greately appreciated.

Thank you,
Ana

0
Iana Tsolova
Telerik team
answered on 21 Mar 2011, 12:57 PM
Hello Tigger,

You can get the edit form and its controls on ItemCreated or ItemDataBound. The later is to be used when you need to change the values of the form edit controls. More information on how to access the controls is available here (Setting properties without using binding expressions section).

Furthermore, you can handle the ItemCommand event of the grid and to set predefined values for the edit form as shown at the bottom of this topic:
http://www.telerik.com/help/aspnet-ajax/grid-inserting-values-usercontrol-formtemplate.html

Greetings,
Iana
the Telerik team
0
Sheetal
Top achievements
Rank 1
answered on 20 Oct 2013, 12:19 AM
I would like to know when using Radgrid control is it possible to pass parameter values to RadGrid select command from other components in the form?
Tags
Grid
Asked by
Tigger Tag
Top achievements
Rank 1
Answers by
Tigger Tag
Top achievements
Rank 1
Iana Tsolova
Telerik team
Sheetal
Top achievements
Rank 1
Share this question
or