Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
157 views
I want to conditionally bind the images in telerik:template column but the cs code for it never gets executed 

<telerik:GridTemplateColumn  ItemStyle-Width="40px" ItemStyle-Font-Names="Arial" ItemStyle-Font-Bold="true">
    <ItemTemplate>
     
  <asp:ImageButton ID="vote_up" runat="server"  CommandName="up" />
  <br />
  <%#Eval("likes") %>
  <br />
  <asp:ImageButton ID="vote_down" runat="server"   CommandName="down" />
    </ItemTemplate>
    </telerik:GridTemplateColumn>

the Cs code is 

protected void answer_grid_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridTemplateColumn)
        {
            GridDataItem item = e.Item as GridDataItem;
            ImageButton up_url = item.FindControl("vote_up") as ImageButton;
            ImageButton down_url = item.FindControl("vote_down") as ImageButton;
            if (Eval("expr1").ToString().Equals(cur_mem_id))
            {
                if (Eval("liked").ToString().Equals("TRUE"))
                    up_url.ImageUrl = "~/images/up_no";
            }
            else up_url.ImageUrl = "~/images/up_logo.png";
 
            if (Eval("expr1").ToString().Equals(cur_mem_id))
            {
                if (Eval("liked").ToString().Equals("FALSE"))
                    down_url.ImageUrl = "~/images/down_no.png";
            }
            else down_url.ImageUrl = "~/images/down_logo.png";
 
 
        }
    }
the code in If block never gets executed 
Shinu
Top achievements
Rank 2
 answered on 06 Feb 2012
4 answers
302 views
With the latest quarterly release of ASP.NET Ajax, Telerik dropped support for ASP.NET 2.0. We'd like to understand ahead of time what Telerik's plans are for continued support for IE6? We'd all love it if corporate users would finally ditch a 9-year-old browser, but users are users.... So, in short, when will Telerik stop supporting IE6 with their new releases?

Thanks,

- Mike Oliver
Craig
Top achievements
Rank 1
 answered on 05 Feb 2012
3 answers
176 views
Hi.
Im using the radajaxmanager.
Is there any way to scroll to anchor #posts after ajax ?

edit:
Code below is what im using to scroll to #posts
Is there any way to animate this scroll, to make it smoother ?

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(OnEndRequest);
function OnEndRequest(sender, args) {
    window.location.hash = '#posts';
}
Mattias Moberg
Top achievements
Rank 1
 answered on 05 Feb 2012
6 answers
103 views
Hi

I need to create an attendance sheet. I would like a user to click on a cell in the grid and the an Edit Popup Form should display containing the selected cells data. The user should be able to edit the cells details using the form and save it to the database. How can I do this?

Thank You
Fred

Fred Mare
Top achievements
Rank 1
 answered on 05 Feb 2012
2 answers
308 views
Hi

I would like to get a radgrid cells value and controls when a context menu item is selected on the client side. How would I do this?

Thank You
Fred
Fred Mare
Top achievements
Rank 1
 answered on 05 Feb 2012
1 answer
80 views
I am using a Telerik skin for my controls in my web application.  I would like to check out the css files that the skin references so I can apply the same look to my asp:label controls.  I installed this particular msi: Telerik.Web.UI_2011_2_712_Dev.msi.

J
J
Top achievements
Rank 1
 answered on 05 Feb 2012
2 answers
139 views
I have a page that has several user controls in it.  The page inherits from a master page, and that master page has a single RadAjaxManager control on it.  Every user control has a RadAjaxManagerProxy that handles ajaxing just the child controls contained inside that user control.  Everything is functional, but there is some behavior I didn't expect.

For example, like I said above, User Control 1 has it's own RadAjaxManagerProxy on it that ajaxifies a RadButton to a RadGrid.  When the button is clicked in User Control 1, the RadGrid is updated as expected; however, User Control 2 is also updated (another user control on the same page with it's own RadAjaxManagerProxy).  Is that behavior expected?  I thought if a button was ajaxified, only the controls specified would be updated when an ajax request was initiated?  So why is User Control 2 updated as well?  Am I misunderstanding the functionality? 
Patrick Rills
Top achievements
Rank 1
 answered on 04 Feb 2012
2 answers
158 views

I had this Error
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
when i tried to add new record.

Update work fine with RadInputManager to validate the textbox/NumuricTextbox.
I think it might be my js conditionalPostback and validateRadUpload for disable ajax to update Image from RadUpload

Here my aspx file

<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="ManageRecipes.aspx.cs" Inherits="GroceryStore.AdminPanel.ManageRecipes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
            <script type="text/javascript">
                function rowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
 
                function conditionalPostback(sender, eventArgs) {
                    var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
                    if (eventArgs.get_eventTarget().match(theRegexp)) {
                        var upload = $find(window['UploadId']);
 
                        //AJAX is disabled only if file is selected for upload
                        try{
                            if (upload.getFileInputs()[0].value != "") {
                                eventArgs.set_enableAjax(false);
                            }
                        }catch(Error){
                        }
                         
                    }
                }
 
                function validateRadUpload(source, e) {
                    e.IsValid = false;
 
                    var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);
                    var inputs = upload.getFileInputs();
                    for (var i = 0; i < inputs.length; i++) {
                        //check for empty string or invalid extension
                        if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) {
                            e.IsValid = true;
                            break;
                        }
                    }
                }
            </script>
 
        </telerik:RadCodeBlock>
 
 
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                        <telerik:AjaxUpdatedControl ControlID="RadInputManager1" />
                        <telerik:AjaxUpdatedControl ControlID="RadInputManager2" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
 
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="conditionalPostback">
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource"
OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated"
OnDeleteCommand="RadGrid1_DeleteCommand" OnUpdateCommand="RadGrid1_UpdateCommand"
OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnInsertCommand="RadGrid1_InsertCommand"
        AllowSorting="True">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="RecipeId" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage"
        AllowPaging="True">
    <DetailTables>
        <telerik:GridTableView runat="server"
            AutoGenerateColumns="False" DataKeyNames="RecipeIngredientId" CommandItemDisplay="Top"
            Name="Ingredient">
            <CommandItemSettings ExportToPdfText="Export to PDF" />
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                <telerik:GridBoundColumn DataField="RecipeIngredientId"
                    FilterControlAltText="Filter RecipeIngredientId column"
                    HeaderText="RecipeIngredientId" UniqueName="RecipeIngredientId" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridDropDownColumn DataField="Name"
                    FilterControlAltText="Filter IngredientName column" HeaderText="Ingredient"
                    UniqueName="IngredientName" DataSourceID="LinqDataSource1"
                    ListTextField="Name" ListValueField="Name">
                </telerik:GridDropDownColumn>
                <telerik:GridBoundColumn DataField="Amount"
                    FilterControlAltText="Filter column1 column" HeaderText="Amount"
                    UniqueName="Amount">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Unit"
                    FilterControlAltText="Filter column2 column" HeaderText="Unit"
                    UniqueName="Unit">
                </telerik:GridBoundColumn>
        <telerik:GridButtonColumn ConfirmText="Delete this Ingredient?" ConfirmDialogType="RadWindow"
        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
            </Columns>
            <EditFormSettings>
                <EditColumn ButtonType="ImageButton">
                </EditColumn>
            </EditFormSettings>
        </telerik:GridTableView>
    </DetailTables>
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
        Visible="True">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
    <telerik:GridEditCommandColumn ButtonType="ImageButton" />
        <telerik:GridBinaryImageColumn DataField="MainImage"
                        FilterControlAltText="Filter Image column" HeaderText="Image"
                        ImageHeight="50px" ImageWidth="50px" ResizeMode="Crop" UniqueName="Image" DefaultImageUrl="~\resources\images\noImageAvailable.jpg">
        </telerik:GridBinaryImageColumn>
        <telerik:GridBoundColumn DataField="RecipeId" DataType="System.Int32"
            FilterControlAltText="Filter RecipeId column" HeaderText="RecipeId"
            ReadOnly="True" SortExpression="RecipeId" UniqueName="RecipeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Name"
            FilterControlAltText="Filter Name column" HeaderText="Name"
            SortExpression="Name" UniqueName="Name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Description"
            FilterControlAltText="Filter Description column" HeaderText="Description"
            SortExpression="Description" UniqueName="Description">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Serving" DataType="System.Int32"
            FilterControlAltText="Filter Serving column" HeaderText="Serving"
            SortExpression="Serving" UniqueName="Serving">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Instruction"
            FilterControlAltText="Filter Instruction column" HeaderText="Instruction"
            SortExpression="Instruction" UniqueName="Instruction">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Cuisine"
            FilterControlAltText="Filter Cuisine column" HeaderText="Cuisine"
            SortExpression="Cuisine" UniqueName="Cuisine">
        </telerik:GridBoundColumn>
        <telerik:GridButtonColumn ConfirmText="Delete this recipes?" ConfirmDialogType="RadWindow"
        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
    </Columns>
 
<EditFormSettings>
                    <EditColumn ButtonType="ImageButton" />
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
</telerik:RadGrid>
        </telerik:RadAjaxPanel>
 
<telerik:RadInputManager runat="server" ID="RadInputManager1" Enabled="true">
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting1">
            </telerik:TextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting2">
            </telerik:TextBoxSetting>
            <telerik:NumericTextBoxSetting BehaviorID="NumericTextBoxSetting1" Type="Number"
                AllowRounding="true" DecimalDigits="0">
            </telerik:NumericTextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting3">
            </telerik:TextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting4">
            </telerik:TextBoxSetting>
</telerik:RadInputManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
 
        <telerik:RadInputManager runat="server" ID="RadInputManager2" Enabled="true">
            <telerik:NumericTextBoxSetting BehaviorID="NumericTextBoxSetting11" Type="Number"
                AllowRounding="true" DecimalDigits="0">
            </telerik:NumericTextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting11">
            </telerik:TextBoxSetting>
        </telerik:RadInputManager>
        <telerik:RadWindowManager ID="RadWindowManager2" runat="server" />
 
 
 
 
 
    <asp:LinqDataSource ID="LinqDataSource1" runat="server"
        ContextTypeName="GroceryStore.GroceryStoreDataContext" EntityTypeName=""
        TableName="Ingredientdatas" Select="new (Name)">
    </asp:LinqDataSource>
</asp:Content>
Weilun
Top achievements
Rank 1
 answered on 04 Feb 2012
2 answers
74 views
I have radtab with following code  and building the child tab dynamically. How to set different skin to childtabs built dynamically

 

<

telerik:RadTabStrip ID="RadTabStrip1" runat="server" AutoPostBack="true"

SelectedIndex="1" Width="100%" onclienttabselected="tabClicked" Skin="Web20">

</telerik:RadTabStrip>


Server code to add chidltabs

For Each dr As DataRow In readerdt.Rows
Dim tab_item As New Telerik.Web.UI.RadTab
tab_item.Text = dr.Item(0)
tab_item.SelectedCssClass = tabSelected"
parent.Tabs.Add(tab_item)
Next

 

Thanks

NVB
Top achievements
Rank 1
 answered on 03 Feb 2012
6 answers
110 views
Hi,

I've been looking for a way to get a view button on a grid to open a raddock for the current row and present read only data for it - kind of the view mode to look like the edit mode with a popup form.  I think that the raddock will look closer to the popup form than a radwindow.

Now one way that I could acheive this is to open a new page inside the dock or even just call some server side code to populate labels containing the view data.  

There must be a better way though that can work more seamlessly with the RadGrid.  Has anyone done this before or know of any good examples on the site (I may have missed some).

Thanks in advance for any pointers.

Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 03 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?