Job Module Commands

Posted by Community Admin on 05-Aug-2018 15:17

Job Module Commands

All Replies

Posted by Community Admin on 14-Oct-2010 00:00

I'd like to have the ability to have a record added in the modules page, but I can't seem to get the InsertCommand to fire, what am I missing?

        protected override void InitializeControls(GenericContainer controlContainer) 
             
            this.RadGrid1.NeedDataSource += 
               new GridNeedDataSourceEventHandler(this.RadGrid1_NeedDataSource);
  
            this.RadGrid1.InsertCommand +=  
               new GridCommandEventHandler(this.RadGrid1_InsertCommand); 
         
    
        protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e) 
         
            try
             
                this.Status.ShowNeutralMessage(e.CommandName.ToString() + " command issued"); 
                this.StatusLabel.Text = e.CommandName.ToString(); 
             
            catch (Exception ex) 
             
                this.Status.ShowNegativeMessage(ex.ToString()); 
             


<telerik:RadGrid ID="RadGrid1" Width="99.8%"  runat="server" Gridlines="None" 
   ShowStatusBar="True"
   OnInsertCommand="RadGrid1_InsertCommand"
   AllowSorting="True" AllowPaging="True"  >

Posted by Community Admin on 15-Oct-2010 00:00

Hello Kristian,

Thank you for reporting that. You are actually doing everything as it should be, there seems to be a bug with the content lifecycle of the Sitefinity page that we have to resolve. For some reason the grid events are not called properly. I have logged the issue and it should be resolved by our development team in a timely manner.

Until then please excuse us for any inconvenience. Thank you once again for contacting us and sharing your early feedback, if you have any other questions please don't hesitate to contact us again.

Regards,
Hristo Borisov
the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 15-Oct-2010 00:00

Thanks guys, that was driving me crazy! Well I can work around it for now, thanks for the quick response!

Posted by Community Admin on 18-Oct-2010 00:00

The delete command works, but im having some difficulty getting the item I want to delete, how would i get the selectedindex of the grid?

    <telerik:RadGrid ID="RadGrid1" Width="99.8%" runat="server" Gridlines="None"
ShowStatusBar="True" OnDeleteCommand="RadGrid1_DeleteCommand" AllowSorting="True" AllowPaging="True"  >

<telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton" CommandName="Delete" />

protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)
    foreach(GridDataItem dataItem in RadGrid1.Items)
    
        if(dataItem.Selected)
        this.StatusTop.ShowNeutralMessage(dataItem["FirstName"].Text);
                

Posted by Community Admin on 21-Oct-2010 00:00

Hi Kristian,

Since you are executing the command on a single item there are no selected items in the grid. You can try the following:

1) Add a hidden row which will hold item's ID:

<telerik:GridBoundColumn DataField="Id" UniqueName="Id" Display="false"></telerik:GridBoundColumn>

2) In edit command get the id of the item to delete:

protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)
    if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
    
        GridDataItem dataItem = e.Item as GridDataItem;
        Guid itemId = new Guid(dataItem["Id"].Text);
    
     

If you wish to perform multiple selection and select multiple items and delete them you will have to modify the Grid a little bit more:
<telerik:RadGrid ID="RadGrid1" Width="99.8%" AllowMultiRowSelection ="true" runat="server" Gridlines="None" ShowStatusBar="True" AllowSorting="True" AllowPaging="True" OnDeleteCommand="RadGrid1_DeleteCommand" >
    <PagerStyle Mode="NextPrevAndNumeric" />
    <MasterTableView AutoGenerateColumns="False" Summary="RadGrid table" AllowAutomaticInserts="true" CommandItemDisplay="TopAndBottom">
        <CommandItemTemplate>
            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete">Delete selected customers</asp:LinkButton>
        </CommandItemTemplate>
        <Columns>
            <telerik:GridBoundColumn DataField="Id" UniqueName="Id" Display="false"></telerik:GridBoundColumn>
            <telerik:GridClientSelectColumn ></telerik:GridClientSelectColumn>
            <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" />
            <telerik:GridBoundColumn  DataField="LastName" HeaderText="Last Name" />
            <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone Number" />
            <telerik:GridDateTimeColumn DataField="DateCreated" HeaderText="Submission Date" />
            <telerik:GridBoundColumn DataField="HowDidYouHear" HeaderText="Referrer" />
            <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:HyperLink runat="server" ID="DocumentLink" NavigateUrl='<%# Eval("MediaUrl") %>' Text='Download'/>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton" CommandName="Delete" />
        </Columns>
     </MasterTableView>
     <ClientSettings>
        <Selecting AllowRowSelect="true" />
     </ClientSettings>
</telerik:RadGrid>

Then in the delete command handler:
protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)
    if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
    
        GridDataItem dataItem = e.Item as GridDataItem;
        Guid itemId = new Guid(dataItem["Id"].Text);
    
    else if (e.Item.ItemType == GridItemType.CommandItem)
    
        GridItemCollection selectedItems = RadGrid1.SelectedItems;
    


Kind regards,
Radoslav Georgiev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 21-Oct-2010 00:00

Thanks Radoslav, that works perfectly!


I have one other question relating the document upload, where does the grid template column get
<%# Eval("MediaUrl") %> from?

I'd like to add more than one document per job applicant, say first one is the resume, and the second document is the cover letter and have both documents in the same entry. I see that the url for the document is

item.UrlName = title + 

 

"_Application"; Is it possible to add another document?

Posted by Community Admin on 22-Oct-2010 00:00

Hi Kristian,

Thank you for getting back to me.

The <%# Eval("MediaUrl") %> is coming from the type of objects to which the Grid is bound to. It is populated with document items and  the MediaUrl is a property of the document item object. You can allow user uploading additional documents by extending the JobApplicationUpload control by copying the functionality which uploads a document.

Kind regards,
Radoslav Georgiev
the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 30-Nov-2010 00:00

"Thank you for reporting that. You are actually doing everything as it should be, there seems to be a bug with the content lifecycle of the Sitefinity page that we have to resolve. For some reason the grid events are not called properly. I have logged the issue and it should be resolved by our development team in a timely manner."

Hi Hristo,

Was this fixed in the Sitefinity 4 RC release?

I am creating a custom module (in Sitefinity 4 RC) using RADGrid and I am having the same issue.
OnDeleteCommand works fine.
OnInsertCommand and OnDeleteCommand don't fire :-(

Posted by Community Admin on 07-Dec-2010 00:00

Hello,

The problem with RadGrid events has not been fixed yet. I hope that we will manage to sort out the issue in one of the next weekly builds.

Greetings,
Ivan Dimitrov
the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 23-Jan-2011 00:00

Hello Support,

We have now upgraded to the final release of 4.0.
But looks like the issue with RadGrid events still remains.

Can you confirm if there is a solution for this problem expected any time soon - as it's delaying the launch of our custom module.


Posted by Community Admin on 26-Jan-2011 00:00

Hi,

We are currently working on this problem.

We have identified the exact cause for this and are looking for a solution. Unfortunately we cannot give you an estimate for the fix as the issue is not so easy to fix.

Greetings,
Radoslav Georgiev
the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.

Posted by Community Admin on 02-Mar-2011 00:00

Is there any ETA on the fix?

Because we are experiencing the same issue.

The same UserControl with a RadGrid on a stand-alone ASPX Page works 100% fine. As soon i add the same Control as a Widget to a page inside Sitefinty, the insert and edit command dont work. 

And another strange behaviour i've found, it doesn't ask for confirmation when i want to delete a record.

Regards

Dave


PS: Is there any news on extending built in modules like generic content? As of yet it seems the huge amount of work needed to add some simple content (e.g. Contacts, Teasers, Locations,...) is way to big. I am much faster just go the old "SQL" way! Is it too hard to allow a developer to copy-paste the Generic Content Module and add some Fields?

Posted by Community Admin on 02-Mar-2011 00:00

Hello David,

We are expecting a fix for server side events not properly firing for 2011 Q1 release.

As for extending built in modules - you can create custom fields for built in modules from the UI. We use an ORM which handles our data layer and database schema. Pure SQL cannot be used to extend built in modules.  With the upcoming SP release we are going to provide documentation on how to create custom modules based on our built in modules.

All the best,
Radoslav Georgiev
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!

Posted by Community Admin on 02-Mar-2011 00:00

Yeah you are right, it is possible to add custom fields, but imagine i have like 5 content types with each different fields. It's not an option to merge all of these fields into one Content Type as my customer never would agree to that.

The perfect solution would be the generic point of view. The developer generates a new module in the interface and selects a "Module Template" (like: "Generic Content Template"). So the developer could create 5 Modules and add custom fields to it. That would be usable.

As an engineer i am aware of the huge amount of work doing CMS. But its quite disappointing that a telerik cms doesn't fully support telerik controls. Well i look forward for any patches, hotfixes or Service Packs.

Posted by Community Admin on 13-Jul-2011 00:00

Is this fixed yet?  I have the same issue with a back-end module that uses RadGrid. The InsertCommand is not firing! Plase help. Is there a PITS number we can follow?

Posted by Community Admin on 14-Jul-2011 00:00

Hi Amir,

The issue with events has been fixes. Please make sure that you have enabled the ViewState of the page and you are subscribing for the ItemCommand event of the RadGrid.

Kind regards,
Ivan Dimitrov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

This thread is closed