Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
322 views
I've a bit of a problem with Telerik radcomboboxes not updating properly on an aspx page. Essentially a user picks a choice 'yes' or 'no' from radcombobox 1. If the user chooses 'yes' then radcombobox 2 should show and radcombobox 3 should be hidden; if the user chooses 'no' then radcombobox 3 should show and radcombobox 2 should be hidden.

The code behind is vb.net. On the aspx page, combo box 1 is ajaxed and supposed to update the other two radcomboboxes. In the code behind in the SelectedIndexChanged sub for radcombobox 1, the 'visible' property of the radcombobox 2 and 3 are swapped depending on the user's choice.The problem is that the radcomboboxes do not appear to be swapping (i.e., updating on the aspx page) unless the page is reloaded, which I'm assuming happens because reloading the page is in essence forcing a postback.

I don't want to force a postback to fix this issue as I feel like that's a brute force workaround, and I want to understand why the logic isn't working as it should.Here's the actual code below. I used generic names for the radcomboboxes above. 
<telerik:AjaxSetting AjaxControlID="cboKey">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="cboKey" />
                <telerik:AjaxUpdatedControl ControlID="cboKey_X2" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="cboKey_X2">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="cboKey_X2" />
<telerik:AjaxUpdatedControl ControlID="cboKey" />
            </UpdatedControls>
        </telerik:AjaxSetting>


Here's the code from combo box 1 SelectedIndexChanged sub:
If Me.cboKey.Visible = True OrElse Me.cboKey_X2.Visible = True Then
If piX2 <> 0 Then
    Me.cboKey.Visible = False
    Me.cboKey_X2.Visible = True
ElseIf piX2 = 0 Then
    Me.cboKey_X2.Visible = False
    Me.cboKey.Visible = True
End If

Any help understanding why this doesn't work would be greatly appreciated!
Amy
Top achievements
Rank 1
 answered on 24 Nov 2014
1 answer
150 views
I've this code behind:
GridEditCommandColumn editCol = (GridEditCommandColumn)rgPropDocs.MasterTableView.GetColumn("EditCommandColumn");
ResponseDocument checkDoc = null;
checkDoc = svc.GetDoc(new Guid(item.GetDataKeyValue("ID").ToString()), new Guid(PID));
Literal litFileUploaded = (Literal)item.FindControl("litFileUploaded");

if (checkDoc == null)
{
editCol.EditText = "Add";
litFileUploaded.Text = "Not Uploaded";
}
else
{
//we have document for this type
editCol.EditText = "Edit";
litFileUploaded.Text = checkDoc.OriginalFileName;
}

on the grid I get the first row with correct edit text of "edit" but then the 2nd row is also coming to "edit" in place of "add" and third row I get it correct which is "add".  The above code is in item databound event.
Neepa
Top achievements
Rank 1
 answered on 24 Nov 2014
1 answer
257 views
How to bring the Export to Excel icon from right position to left position of the grid?
Kostadin
Telerik team
 answered on 24 Nov 2014
14 answers
526 views

Hello,

I'm using the following to provide checkboxes for row selection in one of my grids:

<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">  
    <HeaderStyle Width="20px"></HeaderStyle> 
</telerik:GridClientSelectColumn> 

I'd like to be able to filter the contents of the grid based upon whether or not a row is selected.  E.g. display all rows, only those selected, or only those not selected.  I'm figuring it's not as simple as just setting AllowFilteringByColumn="true", but would like to know if it's possible through built-in means or if I have to do it through some custom code.  As simple as this seems, I couldn't find anything about it in the forums.

Currently, when setting AllowFilteringByColumn to true, I get the filter boxes on all of my other columns, but nothing on this one as for filter options.

I'm using Q32008 .NET 3.5 version of the controls.

Any help is greatly appreciated.
Thanks in advance,
Marty
Maria Ilieva
Telerik team
 answered on 24 Nov 2014
11 answers
264 views
Hi,

I am trying to open a radwindow from radgrid edit link template field . This is done from clientclick script I mean as follows
OnClientClick="return windowopen();"  but the thing is , I have 4 records as of now. the radwindow needs to get displayed appropriately beneath each row.
I mean if it is first row , the window should get opened below that. if it is 4th row , or nth row the window should get opened beneath that.


Kindly help.


-Thanks
Gayathri
Konstantin Dikov
Telerik team
 answered on 24 Nov 2014
1 answer
88 views
I have a RadScheduler that displays multiple resources on a single view (DayView). Is there a way to control the ability to add/edit/delete appointments within a single resource independent of the other resources? I have security that I want to apply and I cannot figure out how to do it. Something like a Readonly at the Resources level or AllowInsert at that level.
Boyan Dimitrov
Telerik team
 answered on 24 Nov 2014
1 answer
170 views

I am creating one entry screen using RadGrid in Batch Edit Mode. My Grid is having mainly some columns of ComboBox (rdcombPayCodeNm) and  TextBox ("txtHours" or "txtAmount"). I have added attribute like "PaidInAmount"/"PaidInHours" in RadCombo in PageLoad.  I want to verify textBox value based on user selected item and their attribut value of ComboBox. Suppose user selected one item in combo and their attribute value is  "PaidInAmount" then user should not enter any value in "txtHours" textbox and opposite if user selected combobox attribute is "PaidInHours" then there should be any value in "txtAmount" textbox. There would be multiple row in grid and I have to validate one by one row and show message to user. I want to perform this operation in client side as I can't read grid value in server side in BatchEdit mode.

I am copying my aspx code and code behind for your ref.

ASPX
------------------------------------------------------------------
<telerik:RadGrid ID="rdgvOtherPay" runat="server" AllowAutomaticInserts="True" AllowAutomaticUpdates="true" AllowMultiRowEdit="true" AllowPaging="True"
    AutoGenerateColumns="False" CellSpacing="0" OnNeedDataSource="rdgvOtherPay_NeedDataSource"
    GridLines="None"
    PageSize="12" AllowMultiRowSelection="true">
    <ClientSettings>
        <ClientEvents OnBatchEditSetEditorValue="setEditorValue" OnRowCreated="rowCreated" OnBatchEditOpened="editOpened" />
    </ClientSettings>
    <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText=""
        CommandItemSettings-CancelChangesText="" CommandItemSettings-RefreshText="" CommandItemSettings-ShowRefreshButton="false"
        CommandItemSettings-ShowSaveChangesButton="false" CommandItemSettings-ShowCancelChangesButton="false" DataKeyNames="idEmpOtherPay"
        Dir="rtl" EditMode="Batch" HorizontalAlign="NotSet" InsertItemDisplay="Bottom">
        <BatchEditingSettings EditType="Row" />
        <SortExpressions>
            <telerik:GridSortExpression FieldName="idEmpOtherPay" SortOrder="Descending" />
        </SortExpressions>
        <Columns>
            
            <telerik:GridTemplateColumn DataField="PayCodeId" HeaderStyle-Width="110px" HeaderText="Pay Code" UniqueName="PayCodeId">
                <ItemTemplate>
                    <%# Eval("PayCodeName") %>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadComboBox ID="rdcombPayCodeNm" runat="server" class="TelerikDrop" dir="ltr" DropDownAutoWidth="Enabled" Filter="StartsWith" TabIndex="8"
                         >
                        <Items>
                            <telerik:RadComboBoxItem Text="PayCodeName1" />
                            <telerik:RadComboBoxItem Text="PayCodeName2" />
                        </Items>
                    </telerik:RadComboBox>
                    <span style="color: red; font-size: larger; vertical-align: bottom">
                    </span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="OtherHours" HeaderStyle-Width="90px" HeaderText="Hours" UniqueName="OtherHours">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblOtherHours" Text='<%# Eval("OtherHours") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtHours" runat="server" MaxLength="15" Width="80%">
                        <NumberFormat DecimalDigits="2" GroupSeparator="" />
                    </telerik:RadNumericTextBox>
                    <%--<ajax:popupcontrolextender id="PopupControlExtender1" runat="server" popupcontrolid="Panel1" position="Bottom" targetcontrolid="txtHours" />--%>
                    <span style="color: red; font-size: larger; vertical-align: bottom">
                    </span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            
            <telerik:GridTemplateColumn DataField="OtherAmount" HeaderStyle-Width="90px" HeaderText="Amount" UniqueName="OtherAmount">
                <ItemTemplate>
                    <%# Convert.ToDouble(Eval("OtherAmount")).ToString("0.00") %>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtAmount" runat="server" MaxLength="15" Width="80%">
                        <NumberFormat DecimalDigits="2" GroupSeparator="" />
                    </telerik:RadNumericTextBox>
                    <span style="color: red; font-size: larger; vertical-align: bottom"></span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridButtonColumn ConfirmText="Delete Other Earnings?" ConfirmDialogType="RadWindow"
                ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="50px" ButtonType="ImageButton"
                CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
            </telerik:GridButtonColumn>
        </Columns>
        <PagerStyle Mode="NumericPages" ShowPagerText="False" />
    </MasterTableView>
</telerik:RadGrid>



Code Behind-


            foreach (PayCodeDO _row in payCodeList)
            {
                RadComboBoxItem item = new RadComboBoxItem
                {
                    Value = _row.PayCodeId.ToString() + " " + _row.Description,
                    Text = _row.Description,
                };
                // string noOfHours = Convert.ToString(_row.PaidInAmount);
                item.Attributes.Add("PaidInAmount", _row.PaidInAmount);
                item.Attributes.Add("PaidInHours", _row.PaidInHours);
                item.Attributes.Add("PaidInHrAndAm", _row.PaidInHourseAndAmount);
                payCodeCombo.Items.Add(item);
            }

            payCodeCombo.Items.Insert(0, new RadComboBoxItem(""));



Thank in Advance.

Regards,
Anil

Angel Petrov
Telerik team
 answered on 24 Nov 2014
3 answers
165 views
Hi all,
   Could someone help me with this issue...  I'm wanting to code the AllowedFileExtensions on the server side or make it dymanic...

Code behind:
radAsyncUpload1.AllowedFileExtensions = "doc.docx,pdf.xls".Split(',');

doesn't seem to be working and it fails on the client end.

But when I it's in the control like this it work...

<telerik:RadAsyncUpload ID="radAsyncUpload1" runat="server" AllowedFileExtensions="doc,docx,pdf,xls" />

based on this http://demos.telerik.com/aspnet-ajax/asyncupload/examples/validation/defaultcs.aspx.
Hristo Valyavicharski
Telerik team
 answered on 24 Nov 2014
1 answer
53 views
I have a load-on-demand combobox set with a custom OnItemRequested handler.  The user can start typing a part of a client name, email, address, etc and the custom code will go do a select on the database and return items.

The problem I am having is that IF the items returned from the database do not include the typed text - they are not displayed in the dropdown.  I have set Filter="none" but that does not seem to help.

For Example: I type in ABC - the database finds a match - returns it - and it is databound to the combobox.  However ABC is not actually in the DataTextField or DataValueField - nor is it in any of the fields displayed in the <ItemTemplate> of the dropdown.  In this case, the line does not display.

Is there a workaround for this?  
Nencho
Telerik team
 answered on 24 Nov 2014
2 answers
92 views
Hello,

I'm using a RadGrid with EditForms. I find that when I use GridDropDownColumn, I get a js error generated by telerik's dynamic code when calling the grid edit form.
If I take GridDropDownColumns out of my grid, everything works fine. Even if I'm using a generic GridDropDownColumn with no datafield, I still get the error.

I can't figure out what's causing this, as it worked the day before and I haven't changed anything.

Here's the error message:

Line: 6
Error: Object doesn't support property or method 'toUpperCase'

Here's my grid:

<telerik:RadGrid runat="server" ID="gridMedications" OnItemDataBound="gridMedications_ItemDataBound" OnInsertCommand="gridMedications_InsertCommand" OnDeleteCommand="gridMedications_DeleteCommand" >
    <MasterTableView AutoGenerateColumns="false" NoMasterRecordsText="<i><b>None - Not taking any medications</b></i>"
        CommandItemDisplay="Bottom" EditMode="EditForms" >
        <CommandItemSettings AddNewRecordText="Add Medication" ShowAddNewRecordButton="true" ShowRefreshButton="false" />
        <EditFormSettings EditColumn-InsertText="Add" EditColumn-ButtonType="PushButton" />
        <Columns>
            <telerik:GridBoundColumn DataField="NameOfMed" HeaderText="Medication" UniqueName="NameOfMed" >
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator SetFocusOnError="true" Display="Dynamic" ForeColor="Red" Text=" *Required" />
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ReasonForTaking" HeaderText="Reason for Taking" UniqueName="ReasonForTaking" DefaultInsertValue="" />
            <telerik:GridBoundColumn DataField="FormOfMed" HeaderText="Form Of Medication" UniqueName="FormOfMedCol" ReadOnly="true" />
            <telerik:GridBoundColumn DataField="Prescription" HeaderText="Rx or OTC" UniqueName="PrescriptionCol" ReadOnly="true" />
            <telerik:GridBoundColumn DataField="ForAllergies" HeaderText="For Allergies?" UniqueName="ForAllergiesCol" ReadOnly="true" />
            <telerik:GridDropDownColumn DataField="FormOfMed" HeaderText="Form Of Medication" UniqueName="FormOfMed" Visible="false" ReadOnly="false" />
            <telerik:GridDropDownColumn DataField="Prescription" HeaderText="Rx or OTC" UniqueName="Prescription" Visible="false" ReadOnly="false" />
            <telerik:GridDropDownColumn DataField="ForAllergies" HeaderText="For Allergies?" UniqueName="ForAllergies" Visible="false" ReadOnly="false" />
 
            <telerik:GridButtonColumn ButtonType="LinkButton" Text="Remove" CommandName="Delete" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Maria Ilieva
Telerik team
 answered on 24 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?