Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
1.3K+ views

Hi,

I need to find a way to get the Command Item "Save Changes" Onclick event on the server side. So far i can only capture the event on the ItemCommand event but there is no way of discerning when it comes from the Save changes button.

The long story:

I have a grid that populates with a read only view. I added a template column with a ComboBox. Based on the selection of that ComboBox I will issue an insert command to a separate table.

I was hoping that the built in functionality of the command items would let me override the Save Changes event so I can iterate through all the RadGrid.SelectedItems and do my inserts.

 

I know I can do this using a custom button, but i really hoped there would be some built in functionality for this.

Is there a way of capturing or overriding that event?

 

Eyup
Telerik team
 answered on 26 Oct 2017
0 answers
133 views

Is it possible to have a hierarhical virtualized RadGrid (with detailtable)   ?

The main grid is virtualized, the child grid is populated in the DetailTableDataBind event.

I'm asking because I've tried to add virtualization on the demo code (http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/programmatic-hierarchy/defaultcs.aspx) and on expanding certain rows the client start sending non stop getData calls to the server and retrieves parent datasource over and over again.

 

ioanid
Top achievements
Rank 1
 asked on 26 Oct 2017
8 answers
354 views
what I ahve is several drop downs at the top of my page and a linkbutton.  Once they pick what they want and then pick the link button it should fire the radgrid to load.  What I am finding out though is the radgrid wants to load on page load and it is erroring out everytime becuase it does not have the ids from the dropdownlists, how can I avoid this.  Originally I put in a fillGrid private sub  but then I loast fucntionality of paging and the grid woould never show with the editing fucntionality I have built in.

<telerik:RadGrid ID="myRadGrid" runat="server" Width="75%" BorderWidth="1px" CellPadding="6" GridLines="None" BorderColor="#404040" Skin="Web20">
                       <ExportSettings ExportOnlyData="true" FileName="DonorSlots" IgnorePaging="true" OpenInNewWindow="true"></ExportSettings>
                       <MasterTableView AutoGenerateColumns="false" DataKeyNames="intDeployId" Name="MasterGrid" BorderColor="#404040" Font-Size="9" Font-Names="Veranda,arial,sans-serif" AllowPaging="True" 
                       PageSize="20" PagerStyle-Mode="NumericPages" HeaderStyle-HorizontalAlign="Center" GridLines="Both" BorderWidth="1px" CommandItemDisplay="Top" EditMode="EditForms">
                       <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" ShowExportToExcelButton="false" /><AlternatingItemStyle BackColor="#B0C4DE"  HorizontalAlign="Center" />
                       <ItemStyle HorizontalAlign="Center" /><HeaderStyle ForeColor="White" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
                           <CommandItemTemplate>
                               <table width="100%">
                                   <tr>
                                       <td align="right"><asp:Button ID="btnExport" runat="server" CommandName="ExportToExcel" Text="Export Excel" /></td>
                                   </tr>
                               </table>
                           </CommandItemTemplate>
                           <Columns>
                               <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" EditText="Update"></telerik:GridEditCommandColumn>
                               <telerik:GridTemplateColumn HeaderText="HIST">
                                   <ItemTemplate>
                                           <asp:Image ID="imgLooker" runat="server" ImageUrl="~/Images/ViewResources.gif" ImageAlign="Middle" BorderStyle="None" />
                                           <asp:PopupControlExtender ID="popInfo" runat="server" PopupControlID="pnlPop" TargetControlID="imgLooker" DynamicContextKey='<% #Eval("strSSN") %>' 
                                           DynamicControlID="pnlpop" DynamicServiceMethod="HelloWorld" Position="bottom"></asp:PopupControlExtender>
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                               <telerik:GridBoundColumn DataField="strFullname" HeaderText="NAME" />
                               <telerik:GridBoundColumn DataField="strPrevUic" HeaderText="PRIOR UIC" />
                               <telerik:GridBoundColumn DataField="strPara" HeaderText="PARA" />
                               <telerik:GridBoundColumn DataField="strLine" HeaderText="LINE" />
                               <telerik:GridBoundColumn DataField="strGrade" HeaderText="GRADE" />
                           </Columns>
                           <EditFormSettings EditFormType="Template">
                               <FormTemplate>
                                       <table width="100%">
                                       <tr>
                                           <td style="width:50%" align="right">Prior Uic: </td>
                                           <td style="width:50%" align="left"><asp:TextBox ID="txtPriorUic" runat="server" Width="100px" Text='<%# Bind("strPrevUic") %>'></asp:TextBox></td>
                                       </tr>
                                       <tr>
                                           <td style="height:5px"></td>
                                       </tr>
                                       <tr>
                                           <td style="width:50%" align="right">Para: </td>
                                           <td style="width:50%" align="left""><asp:TextBox ID="txtpara" runat="server" Width="100px" Text='<%# Bind("strPara") %>'></asp:TextBox></td>
                                       </tr>
                                       <tr>
                                           <td style="height:5px"></td>
                                       </tr>
                                       <tr>
                                           <td style="width:50%" align="right"> Line: </td>
                                           <td style="width:50%" align="left"><asp:TextBox ID="txtLine" runat="server" Width="100px" Text='<%# Bind("strLine") %>'></asp:TextBox></td>
                                       </tr>
                                       <tr>
                                           <td style="height:5px"></td>
                                       </tr>
                                       <tr>
                                           <td style="width:50%" align="right">Return Grade: </td>
                                           <td style="width:50%" align="left"><asp:DropDownList ID="ddlRank" runat="server" CausesValidation="false" Width="105px">
                                                   <asp:ListItem Value="0">Pick Grade</asp:ListItem>
                                                   <asp:ListItem Value="E4">E4 Below</asp:ListItem>
                                                   <asp:ListItem Value="E5">E5</asp:ListItem>
                                                   <asp:ListItem Value="E6">E6</asp:ListItem>
                                                   <asp:ListItem Value="E7">E7</asp:ListItem>
                                                   <asp:ListItem Value="E8">E8</asp:ListItem>
                                                   <asp:ListItem Value="E9">E9</asp:ListItem>
                                                   <asp:ListItem Value="W1">W1</asp:ListItem>
                                                   <asp:ListItem Value="W2">W2</asp:ListItem>
                                                   <asp:ListItem Value="W3">W3</asp:ListItem>
                                                   <asp:ListItem Value="W4">W4</asp:ListItem>
                                                   <asp:ListItem Value="W5">W5</asp:ListItem>
                                                   <asp:ListItem Value="O2">O2 Below</asp:ListItem>
                                                   <asp:ListItem Value="O3">O3</asp:ListItem>
                                                   <asp:ListItem Value="O4">O4</asp:ListItem>
                                                   <asp:ListItem Value="O5">O5</asp:ListItem>
                                                   <asp:ListItem Value="O6">06</asp:ListItem>
                                                   <asp:ListItem Value="O7">O7</asp:ListItem>
                                                   <asp:ListItem Value="O8">08</asp:ListItem>
                                               </asp:DropDownList>
                                           </td>
                                       </tr>
                                   </table>
                                   <table width="100%">
                                           <tr>
                                               <td style="width:50%" align="right"></td>
                                               <td style="width:50%" align="left">
                                               <asp:LinkButton ID="lnkSubmit" runat="server" text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' 
                                               CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'></asp:LinkButton>
                                                     
                                               <asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                                           </td>
                                       </tr>
                                   </table>
                               </FormTemplate>
                           </EditFormSettings>
                       </MasterTableView>
                   </telerik:RadGrid>

Protected Sub myRadGrid_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myRadGrid.NeedDataSource
       Dim DeployId As String = Convert.ToInt16(ddlDeployment.SelectedValue.ToString())
       Dim Bn As String = ddlBn.SelectedValue
       Dim Uic As String = ddlUic.SelectedValue
       Dim SqlWhere As String = ""
       If CInt(DeployId) > 0 And Bn = "0" And ddlUic.SelectedValue = "" Then
           SqlWhere = "mu.intMobilizationId = " & ddlDeployment.SelectedValue & " "
       ElseIf CInt(DeployId) > 0 And ddlBn.SelectedValue > "" And ddlUic.SelectedValue = "0" Then
           SqlWhere = "mu.intMobilizationId = " & ddlDeployment.SelectedValue & " and mu.strAAUic = '" & ddlBn.SelectedValue & "'"
       ElseIf CInt(DeployId) > 0 And ddlBn.SelectedValue > "0" And ddlUic.SelectedValue > "0" Then
           SqlWhere = "mu.intMobilizationId = " & ddlDeployment.SelectedValue & " and mu.strAAUic = '" & ddlBn.SelectedValue & "' and mu.intUnitMobId = " & ddlUic.SelectedValue & ""
       End If
       sql = "Select up.intDeployId, up.strPrevUic, up.strPara, up.strLine, up.strGrade, mn.strFullname, up.strSSN From tblMobUnitPersonnel as up INNER JOIN tblMobUnitPosition as p on p.intPositionID = up.intPositionId " _
           & "INNER JOIN tblMOBUnits mu on mu.intUnitMobId = p.intUnitMobID INNER JOIN MnNgPersonnel.dbo.tblMNNatPersonnel mn on mn.strSSN = up.strSSN WHERE " & SqlWhere & " Order by up.strPrevUic, up.strPara, up.strLine"
       myRadGrid.DataSource = getData(sql)
   End Sub




Suresh
Top achievements
Rank 1
 answered on 26 Oct 2017
9 answers
468 views
How do we prevent data binding form occuring in PageLoad and, here's the catch, still get the RadGrid to display including the filters, which we use as a search form? Something like:

        if (e.RebindReason != GridRebindReason.InitialLoad)
            ((RadGrid)sender).DataSource = new object[] { };

Will prevent the data binding, but it will also prevent the user from ever doing a real search :)

Suresh
Top achievements
Rank 1
 answered on 26 Oct 2017
0 answers
160 views

Hi,

Here are my needs :

I would like to select multiple files to upload, then click "open" and at this moment (OnClientFilesSelected) I would like to do some tests against the file names. If file name does not validate the test, I would like to remove it from the files to upload (one by one). But in OnClientFilesSelected, I can only get the number of files and cancel the whole selection.

How can I have access to the selected files collection, edit it, and then continue ?

 

The final goal is to "group" files by their names (without extension) : if I upload a.pdf and a.png, I would like to have a row for a.pdf and create an associated input to it instead of creating a row for each file.

Do you have some ideas ? I didn't find what I want in the AsyncUpload API.

Julien
Top achievements
Rank 1
 asked on 26 Oct 2017
0 answers
67 views
I have ImageEditor but all icons not working I can't fix the problem I have searched and can't find any solution. 
mrwell
Top achievements
Rank 1
 asked on 26 Oct 2017
4 answers
311 views
Hello,

   I am sure you people will help regarding export to word from RadEditor control. I can't export the contents of RadEditor to word file.

This create problem to clients so they know that this is limitation of this control (RadEditor).

 Please help as soon as possible.

Thanks & Regards

Jiten Mutum
kalpa
Top achievements
Rank 1
 answered on 26 Oct 2017
2 answers
352 views
I'm testing on my workstation over a page with RadGrid, and keep getting error due to the grid.get_masterTableView() returns null.

however, the same codes deployed on many other environment has no such issues, I can access the same page without problem.

only if I host the web app on my dev machine and testing it, I have this problem.

I chked and compare the Telerik.Web.UI*.dll , they are same as the other environment.
Telerik.Web.UI.dll , Telerik.Web.UI.Skin.dll
both ver 2011.3.1305.40

what other dependency or setting may cause this difference on my machine?
DownTown
Top achievements
Rank 1
 answered on 26 Oct 2017
14 answers
790 views
i wonder, if it is possible to set shorter time slots like 15 min in RadScheduler?
Thanks

Hevin
Top achievements
Rank 1
 answered on 26 Oct 2017
4 answers
580 views

Hi,

How can i add dynamic templated items to ImageGallery?

I define a template:

 

class ImageGalleryContentTemplate : ITemplate
{
    public String BackgroundImage { get; set; }
    public String HTMLTemplate { get; set; }
 
    public void InstantiateIn(Control container)
    {
        String strC = "";
        if (BackgroundImage != "")
            strC = String.Format("<div style=\"background-image: url({0})\">{1}</div>", BackgroundImage, HTMLTemplate);
        else
            strC = HTMLTemplate;
        container.Controls.Add(new LiteralControl(strC));
    }
}

I tried to use it following way:

ImageGalleryTemplateItem igti = new ImageGalleryTemplateItem();
ImageGalleryContentTemplate template = new ImageGalleryContentTemplate();
template.BackgroundImage = strBigImgUrl;
template.HTMLTemplate = strTemplate;
template.InstantiateIn(igti);

 

 

template.InstantiateIn doesn't accept ImageGalleryTemplateItem and if i use InstantiateIn(ImageGalleryTemplateItem container) instead of InstantiateIn(Control container), i don't use container.Controls.Add(...), because ImageGalleryTemplateItem hasn't .Controls() property.

if I use igti.ContentTemplate = template instead of template.InstantiateIn(igti) project running without errors, but other slides than first not showing.

Please look at this page: http://v2.gom.com.tr/anasayfa

Just below the menu;

- First slider done with RadRotator. Customer wants selector dots and seamless animation.

- Second slider with RadImageGallery, which has this problem (running with igti.ContentTemplate = template).

- Third slider with RadImageGallery, but has only images and working perfectly. But customer wants texts and link button.

How can i add dynamic templated items to ImageGallery OR how to handle it with RadRotator?

rama
Top achievements
Rank 1
 answered on 25 Oct 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?