Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
470 views
i had put a dropdownlist in formtemplate for user to select value.
but how can i assign the selected value from db to the dropdownlist ?

           <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
            </script>
        </telerik:RadCodeBlock>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid_License">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid_License" LoadingPanelID="RadAjaxLoadingPanel1">
                        </telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="divMsgs"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
            <telerik:RadGrid ID="RadGrid_License" runat="server" CellSpacing="0"
            DataSourceID="ODS_License" GridLines="None" style="margin-top: 0px"
            AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" ShowStatusBar="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True">
                <MasterTableView AutoGenerateColumns="False"
                    DataKeyNames="License_To_Operate_ID" DataSourceID="ODS_License"
                    AllowFilteringByColumn="False" AllowPaging="False"
                    CommandItemDisplay="Top">
 
                    <CommandItemSettings ExportToPdfText="Export to PDF" />
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
                        Visible="True">
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
                        Visible="True">
                    </ExpandCollapseColumn>
 
                    <Columns>
                                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                        </telerik:GridEditCommandColumn>
                        <telerik:GridBoundColumn DataField="License_To_Operate_ID"
                            FilterControlAltText="Filter License_Number column" HeaderText="License_To_Operate_ID"
                            SortExpression="License_To_Operate_ID" UniqueName="License_To_Operate_ID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="License_Name"
                            FilterControlAltText="Filter License_Name column" HeaderText="License Name"
                            SortExpression="License_Name" UniqueName="License_Name">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="License_Number"
                            FilterControlAltText="Filter License_Number column" HeaderText="License Number"
                            SortExpression="License_Number" UniqueName="License_Number">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="License_Issuer"
                            FilterControlAltText="Filter License_Issuer column" HeaderText="License Issuer"
                            SortExpression="License_Issuer" UniqueName="License_Issuer">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Valid_From" DataType="System.DateTime"
                            FilterControlAltText="Filter Valid_From column" HeaderText="Valid From"
                            SortExpression="Valid_From" UniqueName="Valid_From" DataFormatString="{0: dd-MMM-yyyy}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Valid_Till" DataType="System.DateTime"
                            FilterControlAltText="Filter Valid_Till column" HeaderText="Valid Till"
                            SortExpression="Valid_Till" UniqueName="Valid_Till" DataFormatString="{0: dd-MMM-yyyy}">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Issue_date" DataType="System.DateTime"
                            FilterControlAltText="Filter Issue_date column" HeaderText="Issue Date"
                            SortExpression="Issue_date" UniqueName="Issue_date" DataFormatString="{0: dd-MMM-yyyy}">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <EditFormSettings EditFormType="Template">
                        <EditColumn FilterControlAltText="Filter EditCommandColumn1 column"
                            UniqueName="EditCommandColumn1">
                        </EditColumn>
    <FormTemplate>
 
        <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none"
            style="border-collapse: collapse;">
            <tr class="EditFormHeader">
            <td style="width:100px">
            <asp:Label ID="Label5" Text="License Type" runat="server"></asp:Label>                                                           
            </td>
            <td>
                <telerik:RadDropDownList ID="rdl_license_type" runat="server" DataSourceID="LDS_License_type" DefaultMessage="Please select..."
                 DataValueField="License_ID" DataTextField="License_name" >
                </telerik:RadDropDownList>  
                <asp:Label ID="Lb_License_ID" runat="server" text='<%# Bind("License_ID") %>'></asp:Label>
     
            </td>
            </tr>
            <tr >
            <td >
            <asp:Label ID="lb" Text="License Number" runat="server"></asp:Label>                                                           
            </td>
            <td>
            <asp:TextBox ID="tb_License_Number" runat="server" Text='<%# Bind("License_Number") %>' TabIndex="2"></asp:TextBox>                                                           
            </td>
            </tr>
            <tr>
            <td>
            <asp:Label ID="Label1" Text="License Issuer" runat="server"></asp:Label>
            </td>
            <td>
            <asp:TextBox ID="tb_License_Issuer" runat="server" Text='<%# Bind("License_Issuer") %>' TabIndex="3"></asp:TextBox>
            </td>
            </tr>
            <tr>
            <td>
            <asp:Label ID="Label2" Text="Issue Date" runat="server"></asp:Label>
            </td>
            <td>
            <telerik:RadDatePicker ID="IssueDatePicker" runat="server" MinDate="1/1/1900" DbSelectedDate='<%# Bind("Issue_Date") %>' TabIndex="4"></telerik:RadDatePicker>
            </td>
            </tr>
            <tr>
            <td>
            <asp:Label ID="Label3" Text="Valid From" runat="server"></asp:Label>
            </td>
            <td>
            <telerik:RadDatePicker ID="RadDatePicker_ValidFrom" runat="server" MinDate="1/1/1900" DbSelectedDate='<%# Bind("Valid_From") %>' TabIndex="5"></telerik:RadDatePicker>
            </td>
            </tr>
                                                                        <tr>
            <td>
            <asp:Label ID="Label4" Text="Valid To" runat="server"></asp:Label>
            </td>
            <td>
            <telerik:RadDatePicker ID="RadDatePicker_ValidTill" runat="server" MinDate="1/1/1900" DbSelectedDate='<%# Bind("Valid_Till") %>' TabIndex="6"></telerik:RadDatePicker>
            </td>
            </tr>
 
               <tr>
                <td align="right" colspan="2">
                    <asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
                        runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>' >
                    </asp:Button
                    <asp:Button ID="btnDelete" Text="Delete" runat="server" CausesValidation="False"
                        CommandName="Delete"></asp:Button>
                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                        CommandName="Cancel"></asp:Button>
 
                </td>
            </tr>
        </table>
    </FormTemplate>
</EditFormSettings>
                    <PagerStyle PageSizeControlType="RadComboBox" />
                </MasterTableView>
                <PagerStyle PageSizeControlType="RadComboBox" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
 
        </telerik:RadGrid>
        <asp:LinqDataSource ID="LDS_License_type" runat="server"
            ContextTypeName="dcLRDBDataContext" EntityTypeName=""
            TableName="db_Dictionary_Licenses">
            </asp:LinqDataSource>
        <asp:ObjectDataSource ID="ODS_License" runat="server"
            SelectMethod="GetLicenseArrayByUserID" TypeName="LRDB">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="0" Name="id" SessionField="SelectedUserID"
                    Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:LinqDataSource ID="LDS_License" runat="server"
            ContextTypeName="dcLRDBDataContext" EntityTypeName=""
            TableName="db_Employee_Licenses" Where="UserID == @UserID">
            <WhereParameters>
                <asp:SessionParameter Name="UserID" SessionField="SelectedUserID"
                    Type="Int32" DefaultValue="0"/>
            </WhereParameters>
        </asp:LinqDataSource>

VB code behind

Protected Sub RadGrid_License_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid_License.ItemCommand
 
 
     If e.CommandName = RadGrid.InitInsertCommandName Then   'Click Add New Record button           
         Dim editColumn As GridEditCommandColumn = CType(RadGrid_License.MasterTableView.GetColumn("EditCommandColumn"), GridEditCommandColumn)
         editColumn.Visible = False
     ElseIf (e.CommandName = RadGrid.RebindGridCommandName AndAlso e.Item.OwnerTableView.IsItemInserted) Then
         e.Canceled = True
     Else
         Dim editColumn As GridEditCommandColumn = CType(RadGrid_License.MasterTableView.GetColumn("EditCommandColumn"), GridEditCommandColumn)
         If Not editColumn.Visible Then  'Click Cancel button (both Insert and Update mode)
             editColumn.Visible = True
         End If
 
         Dim ddlLicense_id As RadDropDownList = DirectCast(e.Item.FindControl("rdl_license_type"), RadDropDownList)
         Dim txtLicense_Number As TextBox = DirectCast(e.Item.FindControl("tb_License_Number"), TextBox)
         Dim txtLicense_Issuer As TextBox = DirectCast(e.Item.FindControl("tb_License_Issuer"), TextBox)
         Dim dateIssue As RadDatePicker = DirectCast(e.Item.FindControl("IssueDatePicker"), RadDatePicker)
         Dim dateValidFrom As RadDatePicker = DirectCast(e.Item.FindControl("RadDatePicker_ValidFrom"), RadDatePicker)
         Dim dateValidTill As RadDatePicker = DirectCast(e.Item.FindControl("RadDatePicker_ValidTill"), RadDatePicker)
         Dim dc As New dcLRDBDataContext
         If e.CommandName = "PerformInsert" Then
 
             If Request.QueryString("EmployeeID") = "" Then  'New Employee
                 Dim rnd As New Random()
                 Dim tmpUserID As Integer 'allow 10 digit only
                 tmpUserID = rnd.Next(100000, 999999) & DateTime.Now.Hour & DateTime.Now.Minute
                 HttpContext.Current.Session("tmpUserID") = tmpUserID
 
                 dc.insertEmployeeLicense(tmpUserID.ToString, ddlLicense_id.SelectedValue, txtLicense_Number.Text.Trim, txtLicense_Issuer.Text.Trim, _
                                            dateIssue.SelectedDate, dateValidFrom.SelectedDate, dateValidTill.SelectedDate, "Y", DateTime.Now, HttpContext.Current.Session("UserID").ToString)
 
             Else
                 dc.insertEmployeeLicense(Request.QueryString("EmployeeID").ToString, ddlLicense_id.SelectedValue, txtLicense_Number.Text.Trim, txtLicense_Issuer.Text.Trim, _
                                            dateIssue.SelectedDate, dateValidFrom.SelectedDate, dateValidTill.SelectedDate, "Y", DateTime.Now, HttpContext.Current.Session("UserID").ToString)
             End If
 
         ElseIf e.CommandName = "Update" Then
             Dim lid As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("License_To_Operate_ID")
             Dim uid As Integer
             If Request.QueryString("EmployeeID") = "" Then
                 uid = HttpContext.Current.Session("tmpUserID").ToString
             Else
                 uid = GetUserIDbyEmployeeID(Request.QueryString("EmployeeID")).ToString
             End If
 
             Dim rec = (From p In dc.db_Employee_Licenses Where p.UserID = uid And p.License_To_Operate_ID = lid).FirstOrDefault
             If Not rec Is Nothing Then
                 rec.License_ID = ddlLicense_id.SelectedValue
                 rec.License_Number = txtLicense_Number.Text.Trim
                 rec.License_Issuer = txtLicense_Issuer.Text.Trim
                 rec.Issue_date = dateIssue.SelectedDate
                 rec.Valid_From = dateValidFrom.SelectedDate
                 rec.Valid_Till = dateValidTill.SelectedDate
             End If
         ElseIf e.CommandName = "Delete" Then
             Dim lid As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("License_To_Operate_ID")
             Dim uid As Integer
             If Request.QueryString("EmployeeID") = "" Then
                 uid = HttpContext.Current.Session("tmpUserID").ToString
             Else
                 uid = GetUserIDbyEmployeeID(Request.QueryString("EmployeeID")).ToString
             End If
             Dim rec2 = (From p In dc.db_Employee_Licenses Where p.UserID = uid And p.License_To_Operate_ID = lid).FirstOrDefault
             If Not IsNothing(rec2) Then
                 dc.db_Employee_Licenses.DeleteOnSubmit(rec2)
                 dc.SubmitChanges()
             End If
         End If
             dc.Dispose()
     End If
 End Sub
 Private Sub RadGrid_License_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid_License.ItemDataBound
     If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
         Dim item As GridEditableItem = e.Item
         'access/modify the edit item template settings here
         Dim list As RadDropDownList = item.FindControl("rdl_license_type")
         'list.DataSource = Country_values
         'list.DataBind()
         If (Not HttpContext.Current.Session("updatedValue") Is Nothing) Then
             list.SelectedValue = 2
             'HttpContext.Current.Session("updatedValue")
         End If
     ElseIf (TypeOf e.Item Is GridDataItem AndAlso Not e.Item.IsInEditMode AndAlso Page.IsPostBack) Then
         Dim item As GridDataItem = e.Item
         Dim label As Label = item.FindControl("Lb_License_ID")
 
         'update the label value
         label.Text = HttpContext.Current.Session("updatedValue")
     End If
 End Sub








Princy
Top achievements
Rank 2
 answered on 02 Sep 2013
1 answer
43 views
We do not have row drag drop enabled (and have explicitly set the flag to false).  However, on iOS Safari, the user can still drag rows out of the grid.

Has this been fixed since Q3 2012?
Angel Petrov
Telerik team
 answered on 02 Sep 2013
3 answers
186 views
Hi,

In RadComboBox if i select or unselect items the text displayed int the box is not changed, it is changing only after some postback event happens. I have a required field validator for combobox, if i clear the complete selection also before saving the old data is displayed in the text box of radcombobox. so,validator is considering that it has value and saving it. please provide a solution
Nencho
Telerik team
 answered on 02 Sep 2013
2 answers
106 views
Hi Guys,

Im busy creating a betting application using C# asp.net.
Pretty much what happens is, at betting sites cashiers will log onto the website and may generate a voucher which is printed and given to customers.

I am using a masterPage, the RadScriptManager and AjaxManager are found on the master page.
My Sales.aspx page which has a RadAjaxPanel which holds a RadMultiPage control that has 2 tabs (scratchcards and vouchers).

My Voucher Tab has a Button (Generate) which will randomly generate a voucher PIN and is supposed to open a rad window after all the code has been executed which it fails to do.

Just as a Test i dropped a button on the page (Outside of the Panel) and was able to successfully open the rad window with that button, but the RadWindow does not open if i try open it from the Generate Button held inside of the MultiPageView Control.

Any Ideas Why?

aspx code for my Panel
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" BorderColor="Gray">
            <telerik:RadTabStrip runat="server" ID="RadTabStrip1" SelectedIndex="0"
                MultiPageID="RadMultiPage1" CssClass="HeaderClass" Skin="Glow" 
                BackColor="#DDDDDD" >
 
                <Tabs>
                    <telerik:RadTab Text="Scratchcards" SelectedIndex="0">
                    </telerik:RadTab>
                    <telerik:RadTab Text="Vouchers" >
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
 
            <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" Width="400px" CssClass="multiPage" >
                <telerik:RadPageView runat="server" ID="RadPageView1" >
                    <div class="CenterDiv">
                        <table style="width:400px;margin-left:25px;">
                            <tr>
                                <td>
                                    <asp:Label ID="Account" runat="server" ForeColor="#444444" Text="Product"></asp:Label>
                                </td>
                                <td>
                                    <telerik:RadComboBox ID="cboProducts" runat="server" Width="100%"></telerik:RadComboBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblSerial" runat="server" ForeColor="#444444" Text="Serial Number"></asp:Label>
                                </td>
                                <td>
                                    <telerik:RadMaskedTextBox ID="tbSerial" runat="server"
                                        AutoCompleteType="Disabled" CssClass="txtBox" DisplayPromptChar=" "
                                        Mask="#########" MaxLength="9" oncopy="return false" oncut="return false"
                                        onpaste="return false" PromptChar=" ">
                                    </telerik:RadMaskedTextBox>
                                </td>
                            </tr>
                        </table>
                        <br />
                        <table style="width:400px;margin-left:25px;">
                            <tr>
                                <td colspan="3">
                                    <asp:Label ID="lblInfo" runat="server" Font-Bold="true" Font-Size="14px" Text=""></asp:Label>
                                    <br />
                                </td>
                            </tr>
                        </table>
 
                        <div class="scratchcardSave">
                            <br />
                            <asp:Button ID="btnCheck" runat="server" onclick="btnCheck_Click"
                                Text="Activate" />
                            <asp:Button ID="btnClear" runat="server" onclick="btnClear_Click"
                                Text="Clear" />
                            <asp:Button ID="btnNewScratchcard" runat="server"
                                onclick="btnNewScratchcard_Click" Text="Sell Another" />
                        </div>
                    </div>
            </telerik:RadPageView>
             
 
            <telerik:RadPageView runat="server" ID="RadPageView2" >
                <div class="CenterDiv">
                    <table style="width:400px;margin-left:25px;">
                        <tr>
                            <td>
                                <asp:Label ID="Label1" runat="server" ForeColor="#444444" Text="Product"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadComboBox ID="cboProductType" runat="server" Width="100%"></telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblVoucherAmount" runat="server" ForeColor="#444444" Text="Amount"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadMaskedTextBox ID="tbGeneratePIN" runat="server"
                                    AutoCompleteType="Disabled" CssClass="txtBox" DisplayPromptChar=" "
                                    Mask="#########" MaxLength="9" oncopy="return false" oncut="return false"
                                    onpaste="return false" PromptChar=" ">
                                            </telerik:RadMaskedTextBox>
                            </td>
                        </tr>
                    </table>
                    <br />
                     
                    <table style="width:400px;margin-left:25px;">
                        <tr>
                            <td colspan="3">
                                <asp:Label ID="lblVoucherPIN" runat="server" Font-Bold="True" Font-Size="14px"></asp:Label>
                                <br />
                            </td>
                        </tr>
                    </table>
 
                    <div class="scratchcardSave">
                        <br />
                        <asp:Button ID="btnVoucherGenerate" runat="server" onclick="btnVoucherGenerate_Click" Text="Generate" />
                        <asp:Button ID="btnVoucherClear" runat="server" onclick="btnVoucherClear_Click" Text="Clear" />
                    </div>
                </div>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
 
        </telerik:RadAjaxPanel>



C# code for the Generate Button inside the PageView control

protected void btnVoucherGenerate_Click(object sender, EventArgs e)
        {
            if (tbGeneratePIN.Text == string.Empty)
            {
                lblVoucherPIN.ForeColor = System.Drawing.Color.Red;
                lblVoucherPIN.Text = "Please insert voucher amount";
            }
            else
            {
                iThNkContext.Prepaid pre = new iThNkContext.Prepaid();
 
                String newID = "";
                newID = Guid.NewGuid().ToString().Replace("-", "");
                newID = newID.Substring(newID.Length - 16);
                newID = newID.ToUpper();
 
                // Add PIN to Prepaid DB
                var userInfo = (from c in db.Currencies
                                from a in db.Accounts
                                from s in db.Sites
                                from u in db.Users
                                where c.CurrencyID == a.CurrencyID &&
                                        a.AccountID == u.AccountID &&
                                        s.SiteID == u.SiteID &&
                                        u.UserID == LoggedUserID)
                                select new
                                {
                                    AccountID = a.AccountID,
                                    CurrencyID = c.CurrencyID,
                                    CurrencySymbol = c.CurrencySymbol,
                                    SiteName = s.SiteName,
                                    AccountName = a.AccountName
                                }).FirstOrDefault();
 
                if (userInfo != null)
                {
                    AccountID = userInfo.AccountID;
                    CurrencyID = userInfo.CurrencyID;
                    CurrencySymbol = userInfo.CurrencySymbol;
                }
 
                try
                {
                    pre.CurrencyID = CurrencyID;
                    pre.AccountID = AccountID;
                    pre.Amount = Convert.ToDecimal(tbGeneratePIN.Text);
                    pre.SerialNumber = ("_");
                    pre.Pin = newID;
                    pre.TransactionTypeID = 2;
                    pre.SalesUserID = LoggedUserID);
                    pre.SalesDate = DateTime.Now;
                    pre.IsActivated = true;
                    pre.IsActive = true;
 
                    db.Prepaids.InsertOnSubmit(pre);
                    db.SubmitChanges();
 
                    pre.SerialNumber = Convert.ToString(pre.PrepaidID).PadLeft(9, '0');
                    db.SubmitChanges();
 
                    Amount = pre.Amount;
                    SerialNumber = pre.SerialNumber;
                    PinNumber = pre.Pin;
                    SiteName = userInfo.SiteName;
                    accountID = userInfo.AccountID;
                    AccountName = userInfo.AccountName;
 
                    // update the database and set isPrinted = 1
                    pre.IsPrinted = true;
                    db.SubmitChanges();
                    tbGeneratePIN.Text = string.Empty;
 
                    RadWindow newWindow = new RadWindow();
                    newWindow.NavigateUrl = "Vouchers.aspx";
                    newWindow.Top = Unit.Pixel(22);
                    newWindow.VisibleOnPageLoad = true;
                    newWindow.Left = Unit.Pixel(0);
                    RadWindowManager1.Windows.Add(newWindow);  
                }
                catch (Exception ex)
                {
                    lblVoucherPIN.ForeColor = System.Drawing.Color.Red;
                    lblVoucherPIN.Text = ex.Message;
                }
            }
        }

Code i am using to open the RadWindow on the button outside of the PageView (This code works only if it is not inside of the PageView)

protected void RadButton1_Click(object sender, EventArgs e)
    {
        RadWindow newWindow = new RadWindow();
        newWindow.NavigateUrl = "http://www.google.com";
        newWindow.Top = Unit.Pixel(22);
        newWindow.VisibleOnPageLoad = true;
        newWindow.Left = Unit.Pixel(0);
        RadWindowManager1.Windows.Add(newWindow);
    }


Thanx in advance
newguy
Top achievements
Rank 1
 answered on 02 Sep 2013
4 answers
656 views
I am using Radgrid Template column button click i show the confirmation.
I need to show yes/no buttion. i using following code.


<ConfirmTemplate>
                <div class="rwDialogPopup radconfirm">
                    <div class="rwDialogText">
                        {1}
                    </div>
                    <div>
                        <a onclick="$find('{0}').close(true);" class="rwPopupButton" href="javascript:void(0);">
                            <span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[Yes]##</span></span></a>
                        <a onclick="$find('{0}').close(false);" class="rwPopupButton" href="javascript:void(0);">
                            <span class="rwOuterSpan"><span class="rwInnerSpan">##LOC[No]##</span></span></a>
                    </div>
                </div>
 </ConfirmTemplate>


and javascript i use

function ConfirmReply(sender, args) {

                var callBackFunction = Function.createDelegate(sender, function(shouldSubmit) {
                    if (shouldSubmit) {
                        this.click();
                    }
                });

                var text = "Do you want to close the message?";
                var ss = radconfirm(text, callBackFunction, 300, 160, null, "Issue Bucket");
args.set_cancel(true);
            }

I get error message

 Object doesn't support property or method 'set_cancel'

 Here:args.set_cancel(true);

if i call outside of grid it is working. Only call from grid template column button getting error.
Please any one help me.

Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Sep 2013
4 answers
139 views
Hello Telerik,

We have a RadGrid and a Gantt in a RadPageView.
The issue is when the RadGrid is set Visible="true" Gantt is no longer display. And when the RadGrid is set Visible="false", the Gantt appears this time.

On screen attached "issue1.png", the RadGrid ist set to Visible = true, so no gantt
On "issue2.png", the RadGrid is set to Visible = false, Gantt appears.

For information, this problem didn't exist before and it does not appear with Chrome and Firefox.
On "issue3.png", see the expected result (from Chrome).

Thanks .

D
Top achievements
Rank 1
 answered on 02 Sep 2013
2 answers
86 views
Hi,

I have RadCaptcha inside panel which is ajaxified with RadAjaxLoadingPanel. When page is loaded, captcha image is displayed properly, but when I click on link to generate new captcha image (EnableRefreshImage=True), no image is shown.

If I move captcha outside of panel, everything works Ok, but this brakes page design.

Best regards
Sid
Sebastian
Top achievements
Rank 1
 answered on 02 Sep 2013
1 answer
82 views
I have found that a grid field cannot be sorted by anything other than "EqualTo" method if the data type is Number. This is an issue for me so I am attempting to create a custom filter for this column. The filter control must be a text box only, no button so that it behaves just like the built in filter for a radgrid. I have tried to find some example but have not been able to. Below is the client side code for the column but i am stuck as to what to do next


<telerik:GridBoundColumn DataField="INPUT_BY" UniqueName="INPUT_BY" HeaderText="Input By"
         AllowFiltering="True" AutoPostBackOnFilter="true" ShowFilterIcon="false">
<FilterTemplate>
  <telerik:RadTextBox runat="server" ></telerik:RadTextBox>
 </FilterTemplate>
</telerik:GridBoundColumn>


Again the desired functionality is to replicate the built in filter functionality but it MUST be able to filter using the contains filter method on a Number data type. Any ideas on how to code that up? Thanks in advance
Princy
Top achievements
Rank 2
 answered on 02 Sep 2013
2 answers
118 views
I am using a telerik radScheduler into my major project. and it is working fine on Local system.
But on live it is not working fine.
I can only view my scheduled activity, drag & drop activity, increase or decrease time span only.
But when i try to create or edit an recurrence activity it open the edit mode but nothing work on it.
Even insert and cancel buttons are also not working on edit mode.
I am showing you simple example of my code over here, please have a look.
 Remember that it is working fine on local machine but on live it is not working.

//on aspx page
 
    <div class="clear"></div>
        <telerik:RadScheduler ID="RadScheduler1" runat="server">
            <AppointmentContextMenus>
                <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
                    <Items>
                        <telerik:RadMenuItem Text="Completed / Re-Initiate" ImageUrl="../Images/right-img.png" Value="complete"/>
                        <telerik:RadMenuItem Text="Notified" ImageUrl="../Images/calender_icon.gif"/>
                    </Items>
                </telerik:RadSchedulerContextMenu>
            </AppointmentContextMenus>
            <TimeSlotContextMenus>
                <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerTimeSlotContextMenu">
                    <Items>
                        <telerik:RadMenuItem Text="New Appointment" ImageUrl="../Images/plus.png" Value="CommandAddAppointment"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="New Recurring Appointment" ImageUrl="../Images/refresh-icon.gif" Value="CommandAddRecurringAppointment"></telerik:RadMenuItem>
                        <telerik:RadMenuItem IsSeparator="true"></telerik:RadMenuItem>
                        <telerik:RadMenuItem Text="Go to today" Value="CommandGoToToday"></telerik:RadMenuItem>
                    </Items>
                </telerik:RadSchedulerContextMenu>
            </TimeSlotContextMenus>
        </telerik:RadScheduler>

//on aspx.cs page
 
    protected void bindCalendar(DataTable dtSchedule)
    {
        RadScheduler1.DataSource = dtSchedule;
        //RadScheduler1.DataSourceID = "schedule_id";
        RadScheduler1.DataKeyField = "schedule_id";
        RadScheduler1.DataStartField = "schedule_from";
        RadScheduler1.DataEndField = "schedule_to";
        RadScheduler1.DataRecurrenceField = "schedule_record_data";
        RadScheduler1.DataDescriptionField = "schedule_description";
        RadScheduler1.DataRecurrenceParentKeyField = "schedule_record_key";
        RadScheduler1.DataSubjectField = "schedule_title";
        RadScheduler1.DataBind();
    }

--table structure
CREATE TABLE [ref].[scheduler](
    [schedule_id] [int] IDENTITY(1,1) NOT NULL,
    [schedule_title] [nvarchar](max) NULL,
    [schedule_from] [datetime] NULL,
    [schedule_to] [datetime] NULL,
    [schedule_record_key] [int] NULL,
    [schedule_record_data] [nvarchar](max) NULL,
    [schedule_description] [nvarchar](max) NULL,
    [activity_type] [nvarchar](max) NULL,
    [schedule_users] [nvarchar](max) NULL,
    [schedule_group] [nvarchar](max) NULL,
    [schedule_sop] [int] NULL,
    [schedule_days] [nvarchar](max) NULL,
    [schedule_occurence] [nvarchar](max) NULL,
    [schedule_by] [int] NULL,
    [schedule_date] [datetime] NULL,
    [schedule_modify_by] [int] NULL,
    [schedule_modify_date] [datetime] NULL,
    [schedule_is_completed] [bit] NULL,
    [schedule_completed_users] [nvarchar](max) NULL,
    [schedule_completed_group] [nvarchar](max) NULL,
    [schedule_is_delete] [bit] NULL,
    [schedule_form] [int] NULL,
    [schedule_division_fkid] [int] NULL,
    [schedule_company_fkid] [int] NULL,
    [schedule_sop_for] [int] NULL,
 CONSTRAINT [PK_scheduler] PRIMARY KEY CLUSTERED
(
    [schedule_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

Prashant
Top achievements
Rank 2
 answered on 02 Sep 2013
1 answer
260 views
Hi,
I am experiencing some problem with the filename of some document.

The users print out articles from internet and upload them as they are using the upload button of the attachmentcolumn. The problem comes when in the file name there are chars like < > ' which in our case cause exceptions.
To avoid the problem I would like to filter (strip out those special chars from the filename) before uploading.
To do so I need to get access to the filename of the file before it gets uploaded, manage it and pass it back to the attachmentcolumn control.
How can I achieve that?

Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?