Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
135 views

I have a radgrid with command buttons to edit items or insert new items.  When editing items, my edit form template has several checkboxes.  I bind the "checked" attribute of these checkboxes to bits in the database to see if they should be checked when the form loads, like so:

 This works just fine when editing, but it doesn't work when inserting a new item since it's a new item and there is no database value to bind to.  So I found code that lets you specify if it is and insert item or not.  The problem is I can't figure out how to do a database bind when using it.  I need something like this:

 when I try this I get the follwing error:

Error 24 The name 'Bind' does not exist in the current context 

I have to believe this is possible, my context is just wrong.  Does anyone know what I am doing wrong?


Kevin
Top achievements
Rank 1
 answered on 15 May 2015
3 answers
154 views

Hello,

I have a Gridview with a autocompletbox and other types of fields inside. The gridview is binded by Sql (SqlDataSource1) and all fields are populated in both Item and Insert mode without any problem, except the Autocompletebox.

The Autocompletebox works fine, meaning that it contains all the values from the SqlDataSource (SqlDataSource4 below) but the value that appears in the item mode (that uses SqlDataSource1) is not populated in editmode.

What is wrong with my code to retreave the SqlDataSource1 value? A codebehind is needed?

Thanks in advance.

 

<MasterTableView DataSourceID="SqlDataSource1" AutoGenerateColumns="False" DataKeyNames="FlowID" CommandItemDisplay="Top " ItemStyle-CssClass="grid">

                <Columns>
                    <telerik:GridBoundColumn DataField="BudgetCode" HeaderText="Budget" SortExpression="BudgetCode" UniqueName="BudgetCode" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="80" HeaderStyle-Width="100"  ></telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings EditFormType="Template">
                    <EditColumn ButtonType="ImageButton" />
                    <FormTemplate>
                                                <telerik:RadAutoCompleteBox ID="ddlBudgetCode" runat="server" DataSourceID="SqlDataSource4" DataTextField="BudgetCode" DataValueField="BudgetCodeId" InputType="Token">
                                                </telerik:RadAutoCompleteBox>
                    </FormTemplate>
                </EditFormSettings>
            </MasterTableView>


Ivan Danchev
Telerik team
 answered on 15 May 2015
2 answers
280 views

Hello,

I am having a hard time finding a concrete definition or documentation on how to retrieve range values from RadSlider. I have tried several ideas I found going through these forums, the demos, and other sites online but to no avail have I found a solution. Is there something I am missing?

Lines 1-2 return the index of the currently selected items, but not the value itself. I found this in the RadSlider demo, but I am not sure how this would work for a date range (represented as a string).

Lines 4-5 allows me to see one of the values, but I am not sure how to get the range and not just one value.

Lines 7-8 allowed me to see the values that I wanted, but when I tried converting the values to datetime variables, Visual Studio returned an error stating that I couldn't convert decimals to datetime.

The end goal is to connect the RadSlider to the RadHtmlChart and have the dates of the chart correlate with what the user chooses in the slider; an example of this would be the Olympic Medal site on the Telerik demos.

 

Any help would be greatly appreciated!

1.Dim temp1 As String = rsDateRange.SelectionStart.ToString()
2.Dim temp2 As String = rsDateRange.SelectionEnd.ToString()
3. 
4.Dim value As Integer = rsDateRange.Value
5.Dim str As String = rsDateRange.Items(value).Value.ToString()
6. 
7.Dim tempStart As RadSliderItem = rsDateRange.Items(rsDateRange.SelectionStart)
8.Dim tempEnd As RadSliderItem = rsDateRange.Items(rsDateRange.SelectionEnd)

Slav
Telerik team
 answered on 15 May 2015
3 answers
288 views
Hello, 
 
I would like to change the value of the editor numAmount based on the selected item in ddlCharge (client side). Using the event OnClientSelectedIndexChanged I can get the selected value but how can I update the numAmount value?
 

I tried something like this, but it doesn't affect the displayed value on the RadNumericTextBox

function SetDefaultAmountCombo(sender, eventArgs) {
    var selected = eventArgs.get_item().get_value();
    if (selected != null) {                                
        $telerik.findControl(document, "numAmount").set_value(40);
    }
}

 

Thanks

<telerik:RadGrid ID="gridOthers" runat="server" GridLines="None" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" DataSourceID="dsOthers"
                                            PageSize="10" AllowPaging="true" AutoGenerateColumns="false" OnBatchEditCommand="gridOthers_BatchEditCommand" ShowFooter="true" Width="700px" HorizontalAlign="Right"
                                            OnItemUpdated="gridOthers_ItemUpdated" OnItemInserted="gridOthers_ItemInserted" OnItemDeleted="gridOthers_ItemDeleted">
                                            <ClientSettings Resizing-AllowColumnResize="false">
                                                <ClientEvents />
                                            </ClientSettings>
                                            <MasterTableView CommandItemDisplay="Top" DataKeyNames="DriverSettlementDetailId" HorizontalAlign="NotSet" EditMode="Batch" DataSourceID="dsOthers"
                                                AutoGenerateColumns="false">
                                                <BatchEditingSettings EditType="Row" />
                                                <SortExpressions>
                                                    <telerik:GridSortExpression FieldName="ChargeDate" SortOrder="Ascending" />
                                                </SortExpressions>
                                                <Columns>
                                                    <telerik:GridBoundColumn DataField="DriverSettlementDetailId" ReadOnly="true" HeaderText="Id" UniqueName="DriverSettlementDetailId">
                                                        <HeaderStyle HorizontalAlign="Center" Width="50px" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridTemplateColumn HeaderText="Type" UniqueName="ChargeId" DataField="ChargeId" DefaultInsertValue="Fuel">
                                                        <ItemTemplate>
                                                            <%# Eval("Charge.ChargeDesc") %>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <telerik:RadComboBox runat="server" ID="ddlCharge" DataValueField="ChargeId" OnClientSelectedIndexChanged="SetDefaultAmountCombo"
                                                                DataTextField="ChargeDesc" DataSourceID="dsChargesOthers" Width="110px">
                                                            </telerik:RadComboBox>
                                                        </EditItemTemplate>
                                                        <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridBoundColumn DataField="Notes" HeaderText="Notes" SortExpression="Notes" ColumnEditorID="editorNotes"
                                                        UniqueName="Notes" FooterText="Total: ">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        <FooterStyle Font-Bold="true" HorizontalAlign="Right" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridTemplateColumn HeaderText="Amount" SortExpression="Amount" UniqueName="Amount"
                                                        DataField="Amount" FooterAggregateFormatString="{0:C2}" Aggregate="Sum">
                                                        <ItemTemplate>
                                                            <asp:Label runat="server" ID="lblAmount" Text='<%# Eval("Amount", "{0:C}") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <span>
                                                                <telerik:RadNumericTextBox Width="95px" runat="server" ID="numAmount" Type="Currency">
                                                                </telerik:RadNumericTextBox>
                                                                <span style="color: Red">
                                                                    <asp:RequiredFieldValidator ID="rfvAmount"
                                                                        ControlToValidate="numAmount" ErrorMessage="*Required" runat="server" Display="Dynamic">
                                                                    </asp:RequiredFieldValidator>
                                                                </span>
                                                            </span>
                                                        </EditItemTemplate>
                                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                        <ItemStyle HorizontalAlign="Right" />
                                                        <FooterStyle HorizontalAlign="Right" />
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridButtonColumn ConfirmText="Delete this record?<br/><strong><i>Remember to click Save Changes before leaving the form</i></strong>" ConfirmDialogType="RadWindow"
                                                        ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="50px" ButtonType="ImageButton"
                                                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                    </telerik:GridButtonColumn>
                                                </Columns>
                                            </MasterTableView>

 
Viktor Tachev
Telerik team
 answered on 15 May 2015
1 answer
206 views
Hi all,

When using the datetimepicker, is there built-in validation to ensure that the end date and time occur after the start date and time?  An error is returned however there is no message.  Can it be disabled or can I intercept to give it more meaning?

Thank you,
  
Rsevern
Top achievements
Rank 1
 answered on 15 May 2015
3 answers
361 views
Hi,

I am facing a problem while using RAD Scheduler.. The problem is
The appointment click event is not firing if the edit option is set to false.
please help me with this issue. i would also like to know how to disable the
menu which i get when i right click on the scheduler.

Pls Help..

Warm Regards
Gokoulane Ravi
Ivan Danchev
Telerik team
 answered on 15 May 2015
6 answers
144 views
Hello,

I have two RadDatePicker on a page with property ClientIDMode of them setted to Static.
The problem is, the calendar is only openning on first RadDatePicker.
If I remove ClientIDMode, letting it be automatically generated, the page works nicelly.
Is there any way to make it work?

<telerik:RadDatePicker ID="iInicioPeriodo" ClientIDMode="Static" runat="server" Width="80" Style="margin-right: 10px;" DateFormat="dd/MM/yyyy">
</telerik:RadDatePicker>
até
<telerik:RadDatePicker ID="iTerminoPeriodo" ClientIDMode="Static" runat="server" Width="80" Style="margin-left: 10px;" DateFormat="dd/MM/yyyy">
</telerik:RadDatePicker>

Best regards,

Henrique
Marin Bratanov
Telerik team
 answered on 15 May 2015
1 answer
64 views

Hi. When we use the old version of telerik and write code like this

<telerik:RadGrid runat="server" ID="RadGridDocuments" AllowPaging="True"
    Width="100%" Height="100%" 
    <PagerStyle Mode="NextPrevAndNumeric" HorizontalAlign="Right" AlwaysVisible="True" />
    <ClientSettings EnableAlternatingItems="True" EnableRowHoverStyle="True">
ResizeGridOnColumnResize="True" />
    </ClientSettings>
    <MasterTableView  TableLayout="Auto" >
          <Columns>
            <telerik:GridTemplateColumn HeaderText="<%$Resources:Resource, Document_Name%>" UniqueName="DocumentName" SortExpression="DocumentName">
                <ItemStyle Wrap="False" />
                <ItemTemplate>
                    <telerik:RadButton ID="LinkButtonDocumentName" ButtonType="LinkButton" CssClass="LinkButton" runat="server" ToolTip='<%# DataBinder.Eval(Container.DataItem, "DocumentName")%>'
                                       Text='<%# DataBinder.Eval(Container.DataItem, "DocumentName")%>' />
                </ItemTemplate>
            </telerik:GridTemplateColumn>

</Columns>

</MasterTableView>
</telerik:RadGrid>

 

that generate radbutton with type linkbutton to anchor element

<a id="ctl00_ContentPlaceHolder1_RadGridUploadedFiles_ctl00_ctl04_LinkButtonUploadedFileName" title="testUpload" class="RadButton RadButton_Default rbLinkButton LinkButton" href="/AppNew/FileManagement/ViewerModel.aspx?source_id=1efdf640-793d-434f-a41a-fcbc263a57f6&amp;viewer_code=ecodomus&amp;facility_id=2fb3a9f8-da52-4d71-aa98-13c526a5eb50"><span class="rbText">testUpload (EcoDomus Model Viewer)</span><input id="ctl00_ContentPlaceHolder1_RadGridUploadedFiles_ctl00_ctl04_LinkButtonUploadedFileName_ClientState" name="ctl00_ContentPlaceHolder1_RadGridUploadedFiles_ctl00_ctl04_LinkButtonUploadedFileName_ClientState" type="hidden" autocomplete="off"></a>

 

but last version of telerik generate a span

 <span id="ctl00_ContentPlaceHolder1_RadGridUploadedFiles_ctl00_ctl04_LinkButtonUploadedFileName" title="house" class="RadButton RadButton_Default rbLinkButton LinkButton rbHovered" tabindex="0"><span class="rbText">house (EcoDomus Model Viewer)</span><input id="ctl00_ContentPlaceHolder1_RadGridUploadedFiles_ctl00_ctl04_LinkButtonUploadedFileName_ClientState" name="ctl00_ContentPlaceHolder1_RadGridUploadedFiles_ctl00_ctl04_LinkButtonUploadedFileName_ClientState" type="hidden" autocomplete="off"></span>

I want anchor element, how can I make telerik to generate the correct markup?

Danail Vasilev
Telerik team
 answered on 15 May 2015
2 answers
82 views

Hi!

Q1 2015 - .Net 4.0 - IE11

Just a simple save of the editor content, which is inside a RadAjaxPanel. It won't save.
I've added the App_Browser IE11 Fix. Also have hidden Div with an editor in it.
The only way I can get it to save is by using the developer tools in IE and emulating IE8

Everything working as expected on all other browsers.

All help appreciated.

Cheers,

Jon

Jon
Top achievements
Rank 1
 answered on 15 May 2015
15 answers
590 views
Hi there, so, my problem is, I have a RadCombobox that's filled from the codebehind. But depending on what record is selected, it fires the SelectedIndexChanged on every postback.

After testing EVERY item from my Combobox, I found this:

My combo has these items:

  1. Foo
  2. Bar
  3. Foo Bar

If I select 'Foo Bar', I have this issue, and SelectedIndexChanged is fired everywhere.
This is because the space character that is comming from my database is the character 160(non-breaking space, \u00A0) and not the usual character 32. And according to this blog post(http://www.adamkoch.com/2009/07/25/white-space-and-character-160/), IE handles them diferently.
If after loading my items, I replace the 160 char for the 32, everything works just fine.

My question is: Did anybody have this problem? is this a bug? Am I doing something wrong?
Nencho
Telerik team
 answered on 15 May 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?